Реализация функции Delay 4
Оформил: DeeCo
Автор: http://www.swissdelphicenter.ch
// 4. Combined Delay
{
Including the Sleep in the loop prevents the app from hogging
100% of the CPU for doing practically nothing but running around the loop.
}
procedure PauseFunc(delay: DWORD);
var
lTicks: DWORD;
begin
lTicks := GetTickCount + delay;
repeat
Sleep(100);
Application.ProcessMessages;
until (lTicks <= GetTickCount) or Application.Terminated;
end;
|