Re: [DOS] How to code for a time delay? - AGAIN

new topic     » topic index » view thread      » older message » newer message

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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu