Skip to main content

wall_clock_now

Function wall_clock_now 

Source
pub fn wall_clock_now() -> SystemTime
Expand description

Returns the current wall-clock time as SystemTime.

Under simulation (simulation + cfg(madsim)), returns virtual wall-clock time from the madsim deterministic scheduler when called from inside a madsim runtime. When called outside a runtime (e.g. plain #[rstest] test bodies), falls back to SystemTime::now(), which under cfg(madsim) is libc-intercepted by madsim and resolves to the same real syscall it would in a normal build. Under normal builds, returns SystemTime::now().

This is the wall-clock seam. It preserves Unix-epoch semantics (unlike tokio::time::Instant which is monotonic and carries no epoch).