nanosleep - high resolution sleep
#include <zircon/syscalls.h>
zx_status_t zx_nanosleep(zx_time_t deadline);
nanosleep() suspends the calling thread execution until deadline passes on ZX_CLOCK_MONOTONIC. A deadline value less than or equal to 0 immediately yields the thread.
To sleep for a duration, use zx_deadline_after and the ZX_<time-unit> helpers:
#include <zircon/syscalls.h> // zx_deadline_after, zx_nanosleep
#include <zircon/types.h> // ZX_MSEC et al.
// Sleep 50 milliseconds
zx_nanosleep(zx_deadline_after(ZX_MSEC(50)));
No rights are required.
nanosleep() always returns ZX_OK.