Wait loop - not busy waiting?

This is a discussion on Wait loop - not busy waiting? within the Windows Programming forums, part of the Platform Specific Boards category; Hi All I'm rather new to C++ (coming from Java), so here is what I hope is an easy one: ...

  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, 01:13 AM
  2. Replies: 8
    Last Post: 12-01-2008, 09:09 AM
  3. A somewhat bizzare problem!!! - WHILE LOOP
    By bobthebullet990 in forum C Programming
    Replies: 3
    Last Post: 03-31-2006, 06: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

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