Sleep(1000); //延时1秒 //另外一个延时 var timeOut:DWORD; begin timeOut:=Gettickcount; while (GettickCount-timeOut)<=1000 do Application.ProcessMessage;
Sleep procedure ------------------------ Delay program execution for a specified number of microseconds.UnitSysUtilsCategoryprogram controlprocedure Sleep(milliseconds: Cardinal);{$IFDEF MSWINDOWS} stdcall; {$ENDIF}DescriptionSleep pauses program executions as specified by the millseconds parameter. Under Windows, Sleep is just a link to the Sleep function in the system API. Under Linux, Sleep calls the usleep library routine.
就一句代码就可: sleep(n); //n为千分之一秒
procedure Delay(dwMilliseconds: Longint); var iStart, iStop: DWORD; begin iStart := GetTickCount; repeat iStop := GetTickCount; Application.ProcessMessages; until (iStop - iStart) >= dwMilliseconds; end;
//另外一个延时
var timeOut:DWORD;
begin
timeOut:=Gettickcount;
while (GettickCount-timeOut)<=1000 do
Application.ProcessMessage;
------------------------
Delay program execution for a specified number of microseconds.UnitSysUtilsCategoryprogram controlprocedure Sleep(milliseconds: Cardinal);{$IFDEF MSWINDOWS} stdcall; {$ENDIF}DescriptionSleep pauses program executions as specified by the millseconds parameter. Under Windows, Sleep is just a link to the Sleep function in the system API. Under Linux, Sleep calls the usleep library routine.
sleep(n); //n为千分之一秒
var
iStart, iStop: DWORD;
begin
iStart := GetTickCount;
repeat
iStop := GetTickCount;
Application.ProcessMessages;
until (iStop - iStart) >= dwMilliseconds;
end;