DelphiFAQ Home Search:
General :: Programming :: Delphi
General Delphi related information.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

Wait for an amount of milliseconds

The Win32 API has the function Sleep(ms : longint); for this purpose.

If you are working with D1, use the following function - it waits for a given amount of milliseconds.
It allows the current application and other applications to process incoming messages:

procedure Delay(ms : longint);
 var
   t1 : longint;
 begin
   t1 := GetTickCount;
   while (GetTickCount - t1) < ms do
     Application.ProcessMessages;
 end;
 

Generated 8:02:20 on Aug 24, 2019