Skip to main content

Clock

Trait Clock 

Source
pub trait Clock: Send + Sync {
    // Required methods
    fn now_unix_secs(&self) -> u64;
    fn now_monotonic(&self) -> Instant;

    // Provided method
    fn now_unix_millis(&self) -> u64 { ... }
}

Required Methods§

Source

fn now_unix_secs(&self) -> u64

Current wall-clock time as Unix epoch seconds.

Source

fn now_monotonic(&self) -> Instant

A monotonically increasing instant for measuring durations. Implementations may return synthetic instants that share a base.

Provided Methods§

Source

fn now_unix_millis(&self) -> u64

Current wall-clock time as Unix epoch milliseconds.

Implementors§