1 var 2 StartTime, EndTime: cardinal; 3 begin 4 StartTime := GetTickCount; 5 sleep(1000); 6 EndTime := GetTickCount; 7 caption := (IntToStr(EndTime - StartTime) + ' ms'); 8 end;
转:Delphi 计算程序运行时间 http://www.delphitop.com/html/chengxu/2882.html