[][src]Trait metered::time_source::Instant

pub trait Instant {
    fn now() -> Self;
fn elapsed_millis(&self) -> u64; }

A trait for any time source providing time measurements in milliseconds.

It is useful to let users provide an unsynchronized (!Send/!Sync) time source, unlike std's Instant.

Required methods

fn now() -> Self

Creates a new Instant representing the current time.

fn elapsed_millis(&self) -> u64

Returns the elapsed time in milliseconds since an Instant was created.

Loading content...

Implementors

impl Instant for StdInstant[src]

Loading content...