Re: sleep() standard function
- Posted by D. Newhall <derek_newhall at yahoo.com> Aug 18, 2006
- 492 views
Jeremy Peterson wrote: > > The sleep function included with Euphoria can only handle integer values. > > Simply changing integer to atom in the function definition allows it to handle > fractional values as well. > > Rob, d'you think you could change this for 3.0? > Thus saving anyone who needs to use fractional times the time of manually > changing > it. > > Jeremy 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