Trait Timer

Source
pub trait Timer {
    // Provided methods
    fn start(&mut self, _: &'static str) { ... }
    fn stop(&mut self, _: &'static str) { ... }
    fn elapsed(&self, _: &'static str) -> Option<Duration> { ... }
}

Provided Methods§

Source

fn start(&mut self, _: &'static str)

Creates or updates a timer with the provided name. The same timer can be started and stopped as many times as needed, and will keep track of the sum of all the time spent

Source

fn stop(&mut self, _: &'static str)

Stops the timer with the provided name. The timer must already exist, or this call will panic. The same timer can be started and stopped as many times as needed, and will keep track of the sum of all the intervals

Source

fn elapsed(&self, _: &'static str) -> Option<Duration>

Implementations on Foreign Types§

Source§

impl Timer for HashMap<&'static str, TimerState>

Implementors§