[][src]Struct timekeeper::TimerSet

pub struct TimerSet<Key: Eq + Hash + Clone, T: Tracker, S: Source> { /* fields omitted */ }

A timer set tracks a collection of timers, of which at most one can be running at any given time.

Methods

impl<Key, T, S> TimerSet<Key, T, S> where
    Key: Eq + Hash + Clone,
    T: Tracker,
    S: Source
[src]

pub fn new() -> Self[src]

Create a new TimerSet with no currently running timer.

pub fn start(&mut self, k: Key)[src]

Starts a specific timer, stopping the currently running timer (if any).

pub fn stop(&mut self)[src]

Stops the currently running timer without starting any others.

pub fn is_running(&self) -> bool[src]

Returns whether the timer is currently running.

pub fn get_stats(&self, k: Key) -> Option<T::Statistics>[src]

pub fn num_nanoseconds(&self, k: Key) -> Option<u64>[src]

Returns the elapsed time in nanoseconds.

pub fn num_microseconds(&self, k: Key) -> Option<u64>[src]

Returns the elapsed time in microseconds.

pub fn num_milliseconds(&self, k: Key) -> Option<u64>[src]

Return the elapsed time in milliseconds.

pub fn num_seconds(&self, k: Key) -> Option<u64>[src]

Returns the elapsed time in seconds.

pub fn num_minutes(&self, k: Key) -> Option<u64>[src]

Returns the elapsed time in minutes.

pub fn num_hours(&self, k: Key) -> Option<u64>[src]

Returns the elapsed time in hours.

Auto Trait Implementations

impl<Key, T, S> Unpin for TimerSet<Key, T, S> where
    Key: Unpin,
    S: Unpin,
    T: Unpin

impl<Key, T, S> Sync for TimerSet<Key, T, S> where
    Key: Sync,
    S: Sync,
    T: Sync

impl<Key, T, S> Send for TimerSet<Key, T, S> where
    Key: Send,
    S: Send,
    T: Send

impl<Key, T, S> RefUnwindSafe for TimerSet<Key, T, S> where
    Key: RefUnwindSafe,
    S: RefUnwindSafe,
    T: RefUnwindSafe

impl<Key, T, S> UnwindSafe for TimerSet<Key, T, S> where
    Key: UnwindSafe,
    S: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]