#include <unistd.h>
|
unsigned int
sleep (unsigned int seconds); |
Time interval is internally represented using 32 bit value(range +-2147483647). any time interval greater 2147483647, returns 0 without sleeping. Hence Maximum sleep time supported here is 35 minutes, 47 seconds.
/** * Detailed description: This test code shows usage of sleep system call , here sample code * sleeps for 2 seconds. **/ #include <unistd.h> int main() { if(sleep(2) < 0 ) { printf("Sleep failed \n"); return -1; } printf("Sleep successful"); return 0; }
Output
Sleep successful
© 2005-2007 Nokia |