Defined in header
int thrd_sleep( const struct timespec* duration,
struct timespec* remaining );
Blocks the execution of the current thread for at least until the TIME_UTC based duration pointed to by
duration has elapsed.
|duration||-||pointer to the duration to sleep for|
|remaining||-||pointer to the object to put the remaining time on interruption. May be NULL, in which case it is ignored|
 Return value
0 on successful sleep, -1 if a signal occurred, other negative value if an error occurred.
remaining may point at the same object, which simplifies re-running the function after a signal.
The actual sleep time may be longer than requested because it is rounded up to the timer granularity and because of scheduling and context switching overhead.
The POSIX equivalent of this function is nanosleep
Time: Mon Feb 2 16:18:41 2015 Time: Mon Feb 2 16:18:42 2015
- C11 standard (ISO/IEC 9899:2011):
- 18.104.22.168 The thrd_sleep function (p: 385)
 See also
| yields the current time slice |
C++ documentation for sleep_for