Re: win32 sleep()
- Posted by chris bensler <bensler at MAILOPS.COM> May 14, 2000
- 498 views
Hi Wolfgang, What do you mean by 'less'? As in more accurate? Well here's a routine I slapped together just cause you tempted me. :) Compared against your's, mine is even more accurate, at least to the third decimal.. and there is no need for any includes, let alone win32. <CODE> function sleeper(atom snooze) atom sleep_timer,slept slept = 0 sleep_timer=time() while slept < snooze do slept = time() - snooze end while return slept end function printf(1,"%3.3f",sleeper(0.125)) <END CODE> it MIGHT be a LITLE more accurate if you make it a procedure and get rid of the slept variable. I only did it that way so I could easily print the elapsed time. Chris