Skip to main content

Clock

Trait Clock 

Source
pub trait Clock {
    // Required method
    fn now_ms(&self) -> u64;
}
Expand description

Minimal monotonic clock.

Implementations must be monotonic: now_ms() never goes backwards within a single instance.

Required Methods§

Source

fn now_ms(&self) -> u64

Current time as milliseconds since an arbitrary epoch.

Implementations on Foreign Types§

Source§

impl<C: Clock + ?Sized> Clock for &C

Source§

fn now_ms(&self) -> u64

Implementors§

Source§

impl Clock for MockClock

Available on crate feature alloc only.
Source§

impl Clock for SystemClock

Available on crate feature std only.