Function rc_usleep#
Defined in File time.h
Function Documentation#
-
void rc_usleep(unsigned int us)#
Sleep in microseconds.
The traditional usleep function, however common, is deprecated in linux as it uses SIGALARM which interferes with alarm and timer functions. This uses the new POSIX standard nanosleep to accomplish the same thing which further supports sleeping for lengths longer than 1 second. This also handles restarting nanosleep with the remaining time in the event that nanosleep is interrupted by a signal. There is no upper limit on the time requested.
- Parameters:
us – [in] microseconds to sleep