Trait time::ClockSource

source ·
pub trait ClockSource {
    type ClockType: ClockType;

    // Required method
    fn now() -> <Self::ClockType as ClockType>::Unit;
}
Expand description

A clock source.

Required Associated Types§

source

type ClockType: ClockType

The type of clock (either Monotonic or WallTime).

Required Methods§

source

fn now() -> <Self::ClockType as ClockType>::Unit

The current time according to the clock.

Monotonic clocks return an Instant whereas wall time clocks return a Duration signifying the time since 12:00am January 1st 1970 (i.e. Unix time).

Implementors§