C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 05-05-2005, 09:48 AM   #1
Registered User
 
Join Date: Mar 2004
Posts: 161
sleep()

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
__________________
This forum is the best one I've ever seen. Great ppl, great coders
BianConiglio is offline   Reply With Quote
Old 05-05-2005, 09:57 AM   #2
Just Lurking
 
Dave_Sinkula's Avatar
 
Join Date: Oct 2002
Posts: 5,005
usleep?
__________________
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Dave_Sinkula is offline   Reply With Quote
Old 05-05-2005, 10:07 AM   #3
Registered User
 
Join Date: Mar 2004
Posts: 161
great, let me try
__________________
This forum is the best one I've ever seen. Great ppl, great coders
BianConiglio is offline   Reply With Quote
Old 05-06-2005, 10:16 AM   #4
.
 
Join Date: Nov 2003
Posts: 293
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.
jim mcnamara is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[pthread] cancellable sleep in win32? cyberfish C++ Programming 2 08-11-2007 02:30 AM
Sleep works with just one thread, but not 2 finkus C++ Programming 5 12-01-2005 09:17 PM
Problem with Sleep() #$@^#$%^ intruder C++ Programming 8 10-11-2004 06:46 AM
why do we require sleep? jinx A Brief History of Cprogramming.com 43 07-14-2004 08:21 AM
Sleep is overrated... Polymorphic OOP A Brief History of Cprogramming.com 24 01-24-2003 12:40 PM


All times are GMT -6. The time now is 04:55 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22