#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.
sleep() can be configured to wake the system from a suspended power conservation mode
when the specified interval expires. See _NutConf() for more details.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
- Functions:
- _NutConf(), alarm(), getitimer(), kill(), nanosleep(), nap(), pause(), sigaction(), signal(), sigpause(), usleep()
PTC MKS Toolkit 10.4 Documentation Build 39.