mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 19:58:30 +00:00
Introduce clock_nanosleep()
This commit is contained in:
parent
fe3216e961
commit
b75a4654cf
33 changed files with 553 additions and 100 deletions
|
@ -24,13 +24,11 @@
|
|||
*
|
||||
* @return 0 on success, or -1 w/ errno
|
||||
* @raise EINTR if a signal was delivered while sleeping
|
||||
* @see nanosleep(), sleep()
|
||||
* @see clock_nanosleep()
|
||||
* @norestart
|
||||
*/
|
||||
int usleep(uint32_t micros) {
|
||||
struct timespec ts = {
|
||||
micros / 1000000,
|
||||
micros % 1000000 * 1000,
|
||||
};
|
||||
struct timespec ts;
|
||||
ts = _timespec_frommicros(micros);
|
||||
return nanosleep(&ts, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue