Skip to main content

MonotonicClock

Trait MonotonicClock 

Source
pub trait MonotonicClock: Send + Sync {
    // Required method
    fn now(&self) -> Duration;

    // Provided method
    fn resolution(&self) -> Duration { ... }
}
Expand description

An elapsed-time source with a stable, arbitrary epoch.

Values must never decrease or wrap during a boot, including across concurrent reads. UTC corrections must not affect this source. Suspend accounting is a platform property; callers must not assume suspended time is included.

Required Methods§

Source

fn now(&self) -> Duration

Provided Methods§

Source

fn resolution(&self) -> Duration

Nominal source quantization; override for custom platform clocks.

Implementors§