Thread: Wait loop - not busy waiting?

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    4

    Wait loop - not busy waiting?

    Hi All

    I'm rather new to C++ (coming from Java), so here is what I hope is an easy one:

    How can I make my application sleep for x milliseconds? All the solutions I have seen are "busy-waiting" solutions that takes 100% CPU time while waiting. What I want is the C++ equivalent to the Java code:

    Thread.sleep(1000);

    Thanks,
    Steffen

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    4
    Ooops. How very embarrasing..

    Sleep(1000)

    /Steffen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Visual Studio Express / Windows SDK?
    By cyberfish in forum C++ Programming
    Replies: 23
    Last Post: 01-22-2009, 02:13 AM
  2. Replies: 8
    Last Post: 12-01-2008, 10:09 AM
  3. A somewhat bizzare problem!!! - WHILE LOOP
    By bobthebullet990 in forum C Programming
    Replies: 3
    Last Post: 03-31-2006, 07:19 AM
  4. when a while loop will stop ?
    By blue_gene in forum C Programming
    Replies: 13
    Last Post: 04-20-2004, 03:45 PM
  5. How to change recursive loop to non recursive loop
    By ooosawaddee3 in forum C Programming
    Replies: 1
    Last Post: 06-24-2002, 08:15 AM