int usleep(useconds_t period);
The usleep() function
suspends the calling thread until either the number of real-time
microseconds specified by period has elapsed or a signal
is delivered to the calling thread. The suspension time may be
longer than requested because the argument value is rounded up to
an integer multiple of the sleep resolution, or due to the
scheduling of other activity by the system.
Is the number of real-time (as opposed to CPU-time) microseconds to suspend
the calling thread. This value must be less than 1,000,000. If this
value is 0, the call has no effect.
If successful, usleep()
returns 0. On failure, it returns -1 and sets errno to
one of the following values:
period is greater than or
equal to 1,000,000.
usleep() 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, sleep()),
as there are on some UNIX platforms.
On 2012/8.1/2012R2/10/2016/2019, waitable timers with 100-nanosecond resolution are available,
so usleep() has microsecond accuracy.
usleep() 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
- _NutConf(), alarm(), getitimer(), kill(), nanosleep(), nap(), pause(), sigaction(), signal(), sigpause(), sleep()
PTC MKS Toolkit 10.3 Documentation Build 39.