Skip to main content

Crate tilo_clock

Crate tilo_clock 

Source
Expand description

Reading the time the same way on every target: now and wall are the sanctioned monotonic and wall-clock reads, and time names the clock types instead of std::time’s, which panic in a browser page. Clock is an injectable time source, for deadline behaviour a test reaches without sleeping.

Modules§

time
The clock types under std::time’s names, for signatures that need one; times are read through now and wall.

Structs§

FixedClock
ManualClock
MonotonicClock
Milliseconds since this process first read a monotonic clock; never moves backwards.
SystemClock

Traits§

Clock

Functions§

from_std
is_synchronised
Whether the device’s clock is synchronised, when the platform can say; None when nothing here knows.
is_zone_name
Whether name names a zone as the time-zone database does (Pacific/Auckland, UTC), and so names no file outside the database either.
local_zone_name
now
pin_wall
Pin the wall clock of the whole process to at for a screenshot capture, so every frame shows the same date. The monotonic clock keeps running.
to_std
try_unix_now
try_unix_now_ms
try_unix_now_ns
unix_now
unix_now_i64
unix_now_ms
unix_now_ms_i64
unix_now_ns
wall
wall_frozen
Whether a clock is held here, so a wall read answers the hold.
with_wall_ms
Hold this thread’s wall clock at now_ms; nested holds restore the one before them. This is how a host lends a clock to code that has none.