Re: [DOS] How to code for a time delay? - AGAIN
- Posted by Juergen Luethje <j.lue at gmx.de> May 28, 2007
- 574 views
Alex Caracatsanis wrote: > One more question: how would I go about shortening the delay interval (to > say 0.5 seconds), as sleep(i) accepts only an integer argument? ie: > <display a star><wait 0.5sec><display another star><wait 0.5sec><...etc> A simple and reliable way is this:
include machine.e tick_rate(100) -- initialize (for DOS only) procedure delay (atom seconds) atom fin fin = time() + seconds while time() < fin do end while end procedure -- Demo ? time() -- display a star here delay(0.5) ? time() -- display next star here
Regards, Juergen