转自:http://www.cnblogs.com/Bung/archive/2011/05/17/2048867.html
//延迟函数:方法一
procedure
delay(msecs:
integer
);
var
Tick: DWord;
Event: THandle;
begin
Event := CreateEvent(
nil
,
False
,
False
,
nil
);
try
Tick := GetTickCount + DWord(msecs);
while
(msecs >
0
)
and
(MsgWaitForMultipleObjects(
1
, Event,
False
, msecs, QS_ALLINPUT) <> WAIT_TIMEOUT)
do
begin
Application
.
ProcessMessages;
msecs := Tick - GetTickcount;
end
;
finally
CloseHandle(Event);
end
;
//延迟函数:方法二
procedure
Delay(dwMilliseconds:DWORD);
//Longint
var
iStart,iStop:DWORD;
begin
iStart := GetTickCount;
repeat
iStop := GetTickCount;
Application
.
ProcessMessages;
until
(iStop - iStart) >= dwMilliseconds;
end
;
转载于:https://www.cnblogs.com/Closeyes/p/3166413.html
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/110085.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...