Module monotonic_clock

Source
Expand description

WASI Monotonic Clock is a clock API intended to let users measure elapsed time.

It is intended to be portable at least between Unix-family platforms and Windows.

A monotonic clock is a clock which has an unspecified initial value, and successive reads of the clock will produce non-decreasing values.

Functions§

now
Read the current value of the clock.
resolution
Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.
subscribe_duration
Create a pollable that will resolve after the specified duration has elapsed from the time this function is invoked.
subscribe_instant
Create a pollable which will resolve once the specified instant has occurred.

Type Aliases§

Duration
A duration of time, in nanoseconds.
Instant
An instant in time, in nanoseconds. An instant is relative to an unspecified initial value, and can only be compared to instances from the same monotonic-clock.
Pollable