zx_nanosleep
Summary
High resolution sleep.
Declaration
#include <zircon/syscalls.h>
zx_status_t zx_nanosleep(zx_instant_mono_t deadline);
Description
zx_nanosleep()
suspends the calling thread execution until deadline passes
on ZX_CLOCK_MONOTONIC
. deadline will be automatically adjusted according to the job's
timer slack policy.
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)));
Rights
None.
Return value
zx_nanosleep()
always returns ZX_OK
.
See also
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-22 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-22 UTC."],[],[]]