- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi 在减少占用资源的情况下,等待MSecs毫秒
//在减少占用资源的情况下,等待MSecs毫秒
procedure WaitSomeTime(MSecs:LongInt);
var FirstTickCount,Now:LongInt;
begin
FirstTickCount := GetTickCount();
repeat
Application.ProcessMessages;
Now := GetTickCount();
until (Now - FirstTickCount >= MSecs) or (Now < FirstTickCount);
end;