PDA

View Full Version : sleep()



BianConiglio
05-05-2005, 09:48 AM
On my mac, sleep() takes as argument a number and this number is the number of SECONDS that the process will sleep.. is there a way to specify some milliseconds like sleep() for windows?
If I put 0.x it will be rounded to 0 :(

Dave_Sinkula
05-05-2005, 09:57 AM
usleep (http://www.rt.com/man/usleep.3.html)?

BianConiglio
05-05-2005, 10:07 AM
great, let me try

jim mcnamara
05-06-2005, 10:16 AM
nanosleep() as well.

But be aware - the time specified for both of these is the MINIMUM. If another process got the cpu while your process was away, your process may not get it back after waking up until a full quantum (time slice) has elapsed. ie., longer sleep time than you wanted.