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#

silk
pub struct WasiClock

WASI clock operations. A host failure or an invalid clock result traps.

Implementation WasiClock#

silk
impl WasiClock

Associated function now#

silk
pub effect fn now() -> Mark

Returns the reading of the monotonic clock. A host failure traps.

Associated function systemNow#

silk
pub effect fn systemNow() -> Instant

Returns the date and time of the wall clock. A host failure or a time that is not valid traps.

Associated function resolution#

silk
pub effect fn resolution(monotonic: bool) -> u64

Returns the selected clock's resolution in nanoseconds. Zero or a host failure traps.

Associated function waitUntil#

silk
pub effect fn waitUntil(when: Mark) -> ()

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.

View the source of this page