Clock

Trait Clock 

Source
pub trait Clock: Send + Sync {
    type Instant: Copy + Send + Sync;

    // Required methods
    fn now(&self) -> Self::Instant;
    fn elapsed_millis(&self, since: Self::Instant) -> u64;
}
Expand description

Provides timing information for the runtime.

Required Associated Types§

Source

type Instant: Copy + Send + Sync

Instant type produced by this clock implementation.

Required Methods§

Source

fn now(&self) -> Self::Instant

Returns the current instant.

Source

fn elapsed_millis(&self, since: Self::Instant) -> u64

Returns the number of milliseconds elapsed since since.

Implementors§