***************************************************************** * Neveprise Inc. Delphi FAQ * ***************************************************************** * Section: Misc Topic: Delay in code * * Created: July 27th, 1999 Revised: July 27th, 1999 * * Updates: www.neveprise.de Info: support@neveprise.de * ***************************************************************** Q: How can I pause my code for some time, as Delay() in TurboPascal did? A: Yes, that was a good command and nearly everyone who was working on Turbo Pascal misses it. But there is a way of emulating it. We just retrieve the time that has passed since Window's last start in milliseconds via GetTickCount(). Then we add our desired pause time to this value and compare the actual TickCount with this value. As long as the actual GetTickCount() retrieves a lower value than GetTickCount+OurDelay, we start a loop that does nothing except telling Windows to do other tasks: procedure DelayH(App: TApplication; ms: longint); var xTime: longint; begin xTime:= GetTickCount+ms; while GetTickCount