Expand description
Clock types that also work in the browser.
std::time::Instant and std::time::SystemTime panic on
wasm32-unknown-unknown, so on WASM these come from web_time, which
reads the JS clocks instead.
Structs§
- Instant
- A measurement of a monotonically nondecreasing clock.
Opaque and useful only with
Duration. - System
Time - A measurement of the system clock, useful for talking to external entities like the file system or other processes.
Constants§
- UNIX_
EPOCH - An anchor in time which can be used to create new
SystemTimeinstances or learn about where in time aSystemTimelies.
Functions§
- now
- Wall-clock reading. On native this is
std::time::SystemTime::now(); on WASM it goes throughDate.now()so it doesn’t panic onwasm32-unknown-unknown. - timestamp_
secs - The current unix timestamp in seconds.