#include <unistd.h>
unsigned int sleep(unsigned int period);
The sleep() function
suspends the calling thread until either the number of real-time
seconds specified by period has elapsed or a signal is
delivered to the calling thread. The suspension time may be
longer than requested because of the scheduling of other activity
by the system.
- period
-
Is the number of real-time (as opposed to CPU-time) seconds to suspend
the calling thread.
If the requested time has
elapsed, sleep() returns a value of zero. If a signal was
delivered, sleep() returns the remaining seconds to sleep.
POSIX.1 (1996).
Async-signal-safe.
sleep() is implemented
using an interruptible wait function, and does not use signals.
Hence there are no interactions with SIGALRM handling,
or with any other wait function (for example, usleep()),
as there are on some UNIX platforms.
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
- Functions:
- alarm(), getitimer(), kill(), nanosleep(), nap(), pause(), sigaction(), signal(), sigpause(), usleep()
MKS Toolkit 9.3 Documentation Build 6.