November 28th, 2006, 01:59 PM
Is there any function like sleep or wait in C ?
November 28th, 2006, 02:16 PM
Yes. sleep() under most *Nixes and Sleep() in Windows. Note the case of the function names. By the way, sleep() takes its parameter in seconds and Sleep() in microseconds.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
November 28th, 2006, 03:14 PM
If you're using the MinGW port of gcc, which is what Dev-C++ uses, then the function is sleep(). Even though the LibC help file states that the parameter is in seconds, it's actually in milliseconds.
It's best to write a short test program to verify what your compiler's version of sleep does.
November 28th, 2006, 04:02 PM
Sleep() is in milliseconds, not microseconds.
November 29th, 2006, 02:33 AM
If using gcc then also there is a function called
November 30th, 2006, 02:51 AM
if your doing windows programming , you can use WaitForSingleObject to wait . The parameter is a handle of a wait object. You can create a semaphore or event as the wait object.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."
- Kristin Wilson, Nintendo, Inc., 1989.