Re: win32 sleep()

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

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

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

Search



Quick Links

User menu

Not signed in.

Misc Menu