silk.platform.wasi.clock.
WASI wall-clock and monotonic-clock operations.
Details#
A host failure traps. Clock waits block the command until the host reports the deadline.
Import as WasiClock with import silk.platform.wasi.clock { WasiClock }.
Public declarations: 1.
WasiClock#
pub struct WasiClockWASI clock operations. A host failure or an invalid clock result traps.
Implementation WasiClock#
impl WasiClockAssociated function now#
pub effect fn now(monotonic: bool) -> InstantReturns monotonic time when monotonic is true, otherwise Unix time.
A host failure traps.
Associated function resolution#
pub effect fn resolution(monotonic: bool) -> u64Returns the selected clock's resolution in nanoseconds. Zero or a host failure traps.
Associated function waitUntil#
pub effect fn waitUntil(when: Instant) -> ()Blocks until the monotonic deadline. A negative or unrepresentable deadline traps. Interrupted waits keep the same deadline. A host failure traps.
Category: Native platform.
Profiles: wasm32-wasip1, wasm32-wasip2.