pub trait Clock {
    fn now() -> Self;
fn set_scaling_factor(&mut self, scaling: usize);
fn duration_since(&self, earlier: Self) -> Duration; }
Expand description

A trait for time sources. This allows methods to be generic over different ways of measuring time.

Required methods

Get a timestamp.

Set a scaling factor, which can be used to convert a difference of timestamps to seconds.

Get the duration from earlier to self as a std::time::Duration.

Panics

If earlier is not earlier.

Implementations on Foreign Types

Implementors