Re[2]: sleep() standard function

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

> I agree. I ran into this problem recently too. In the meantime I've been using
> this procedure:

> -- Waits for a specific amount of time passed to it in seconds
> global procedure wait(atom seconds)
>     atom start_time

>     start_time = time()

>     if integer(seconds) then
>         sleep(seconds)
>     else -- a floating point number
>         while time() - start_time < seconds do -- Nothing
>             -- Busy loop until `seconds` have elapsed
>         end while
>     end if

> end procedure  -- wait


But laptop users will be angry.

If you use windows, use Sleep in kernel32.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu