TOP

延时程序
2017-10-10 12:03:46 】 浏览:10144
Tags:延时 程序

 1 procedure delay(msecs: integer);
 2 var  
 3 Tick: DWord;
 4 Event: THandle;
 5 begin
 6 Event := CreateEvent(nil, False, False, nil); 
 7     try   
 8     Tick := GetTickCount + DWord(msecs);    
 9     while (msecs > 0) and (MsgWaitForMultipleObjects(1, Event, False, msecs, QS_ALLINPUT) <> WAIT_TIMEOUT) 
10     do    
11     begin   
12         Application.ProcessMessages; 
13         msecs := Tick - GetTickcount;   
14         end; 
15     finally    
16     CloseHandle(Event);
17     end;
18 end;
19  
20  

 


延时程序 https://www.cppentry.com/bencandy.php?fid=86&id=130013

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇[教学] Log.d 日志调试查看(所有.. 下一篇Delphi7.0常用函数-属性-事件