sleep()

This is a discussion on sleep() within the Linux Programming forums, part of the Platform Specific Boards category; On my mac, sleep() takes as argument a number and this number is the number of SECONDS that the process ...

  1. #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

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    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.*

  3. #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

  4. #4
    .
    Join Date
    Nov 2003
    Posts
    307
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

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

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