Skip to main content

Clock

Trait Clock 

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

Wall-clock source in milliseconds since the Unix epoch. Tests inject a fake one.

Required Methods§

Source

fn now_ms(&self) -> u64

Current wall-clock time in milliseconds.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§