WasiClock
2 types2 values2 functionsThe host's clocks, read in nanoseconds. realtime tells the time of day; monotonic measures how long something took, since it never goes backwards.
Types
@Clock
Which of the host's clocks to read. Opaque: only this module builds one.
Result
Shorthand for [Ok(a) | Err(e)], the variant this module's fallible
functions return.
Values
realtime
Wall-clock time: nanoseconds since the Unix epoch, which the host may move.
monotonic
A clock that never goes backwards, from an unspecified origin: for measuring how long something took, not for telling the time.
Functions
now
Nanoseconds. now(realtime) is wall-clock time since the Unix epoch;
now(monotonic) counts from an unspecified origin and never goes backwards.
resolution
The clock's tick length, in nanoseconds.