使用 TStopwatch 記錄
最新版本的 Delphi 附帶 TStopwatch 記錄,用於時間間隔測量。用法示例:
uses
System.Diagnostics;
var
StopWatch: TStopwatch;
ElapsedMillseconds: Int64;
begin
StopWatch := TStopwatch.StartNew;
// do something that requires measurement
ElapsedMillseconds := StopWatch.ElapsedMilliseconds;
end;