使用 TStopwatch 计时
uses System.Diagnostics; var t1: TStopwatch; begin t1 := TStopwatch.StartNew; // do something t1.Stop; Memo1.Lines.Add(Format('%d (msec)', [t1.ElapsedMilliseconds])); Memo1.Lines.Add(t1.Elapsed); end;
使用 TStopwatch 计时
uses System.Diagnostics; var t1: TStopwatch; begin t1 := TStopwatch.StartNew; // do something t1.Stop; Memo1.Lines.Add(Format('%d (msec)', [t1.ElapsedMilliseconds])); Memo1.Lines.Add(t1.Elapsed); end;