使用 TStopwatch 记录
最新版本的 Delphi 附带 TStopwatch 记录,用于时间间隔测量。用法示例:
uses
System.Diagnostics;
var
StopWatch: TStopwatch;
ElapsedMillseconds: Int64;
begin
StopWatch := TStopwatch.StartNew;
// do something that requires measurement
ElapsedMillseconds := StopWatch.ElapsedMilliseconds;
end;