[fpc-pascal] platform independant wait

Vincent Snijders vsnijders at quicknet.nl
Sat Mar 4 19:33:26 CET 2006


Marc Santhoff wrote:
> Hi,
> 
> the subject tells what I'm searching for:
> 
> How can i wait a definit amount of time in a platform independant way?
> 
> I need to pause a while loop for 1 second. The program should run at
> least on FreeBSD and Windows.
> 
> <snip>
> while NOT doStop do begin
>         { wait a little }
>         
>         doSomethingUseful;
> end;
> </snip>
> 
> At the moment I'm thinking of using something like
> "Application.ProcessMessages" and measuring the time explicitely, but a
> simple "Wait(1000)" would be best. :)
> 

What about sleep:
http://www.freepascal.org/docs-html/rtl/sysutils/sleep.html

Vincent



More information about the fpc-pascal mailing list