Skip to main content

Clock

Trait Clock 

Source
pub trait Clock {
    type Time: Time;
    type Calibration: DurationCalibration<<Self::Time as Time>::Duration>;

    // Required method
    fn now(&self) -> <Self::Time as Time>::Instant;
}
Expand description

A source of time readings.

Call Clock::now to sample an instant.

Required Associated Types§

Required Methods§

Source

fn now(&self) -> <Self::Time as Time>::Instant

Returns the current instant.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§