Skip to main content

SystemClock

Trait SystemClock 

Source
pub trait SystemClock {
    // Required method
    fn elapsed(&self) -> Duration;
}
Expand description

Something which records the elapsed real time.

This uses shared references because it may be shared between multiple components at any one time.

Required Methods§

Source

fn elapsed(&self) -> Duration

The amount of time that has passed since a clock-specific reference point (e.g. device startup or the unix epoch).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a, C: SystemClock> SystemClock for &'a C

Implementors§

Source§

impl SystemClock for OperatingSystemClock

Available on crate feature std only.