Thread: Wait?

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13

    Question Wait?


    Hi I know there is a function that waits like lets say we want the program to wait for 100 milliseconds you say ?(100) Can someone please help me? thanks
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,643
    Rep Power
    4248
    Depends on your OS, but you're probably looking for the sleep() function. Please note that this function looks and works different depending upon your OS.

    For Windows, it is spelled with the first letter capitalized and takes the time to sleep in milliseconds (i.e.)
    #include <windows.h>
    Sleep(milliseconds);

    For *NIX systems, it is spelled in all lowercase and takes the time to sleep in seconds (i.e.)
    #include <unistd.h>
    sleep(seconds);

    There's also a nanosleep() function in *NIX systems for smaller time intervals.
    Hope this helps!
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13
    o cool thanks

IMN logo majestic logo threadwatch logo seochat tools logo