//取毫秒級時間精度(方法一)
var
t
r
begin
t
sleep(
t
r
showmessage(inttostr(r
end;
//取毫秒級時間精度(方法二)
//use DateUtils;//引用DateUtils單位
var
t
r
begin
t
sleep(
t
r
r
fTVGgU
單位毫秒(ms)
showmessage(inttostr(r
end;
//注
//取系統級時間精度
var
c
t
r
begin
QueryPerformanceFrequency(c
QueryPerformanceCounter(t
sleep(
QueryPerformanceCounter(t
r
L`:(Y\O件}\^k(育*軟{Ux
j
x@\t)ac提W教
YjTt]$
r
r
showmessage(floattostr(r
end;
From:http://tw.wingwit.com/Article/program/Delphi/201311/24725.html