Skip to main content

Clock

Trait Clock 

Source
pub trait Clock {
    // Required methods
    fn current_time_monotonic(&self) -> MonotonicInstant;
    fn current_time_wall_clock(&self) -> WallClockInstant;
}

Required Methods§

Source

fn current_time_monotonic(&self) -> MonotonicInstant

Monotonic time for timeout checking and elapsed time measurement. Cheap on real systems (reads TSC), controllable in simulation.

Source

fn current_time_wall_clock(&self) -> WallClockInstant

Wall-clock time for timestamps (WAL, datetime functions). Controllable in simulation for deterministic behavior.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§