[][src]Trait bmk_linux::timing::Clock

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

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

Required methods

fn now() -> Self

Get a timestamp.

fn set_scaling_factor(&mut self, scaling: usize)

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

fn duration_since(&self, earlier: Self) -> Duration

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

Panics

If earlier is not earlier.

Loading content...

Implementations on Foreign Types

impl Clock for Instant[src]

Loading content...

Implementors

impl Clock for Tsc[src]

Loading content...