Struct hotdrink_wasm::util::timer::Timer [−][src]
pub struct Timer { /* fields omitted */ }
A struct for counting the time some operation takes.
Implementations
impl Timer
[src]
impl Timer
[src]pub fn new() -> Self
[src]
Creates a timer that immediately starts running.
pub fn restart(&mut self)
[src]
Resets all the timer data.
pub fn checkpoint(&mut self)
[src]
Store the current time.
pub fn time_since_start(&self) -> f64
[src]
Returns the total time passed since the timer’s creation or last restart in milliseconds.
pub fn time_since_checkpoint(&self) -> f64
[src]
Returns the total time passed since the last checkpoint in milliseconds.
pub fn average(&self) -> f64
[src]
Returns the average time passed between each checkpoint so far in milliseconds.
pub fn maximum(&self) -> f64
[src]
Returns the maximum time passed between each checkpoint so far in milliseconds.
pub fn minimum(&self) -> f64
[src]
Returns the minumum time passed between each checkpoint so far in milliseconds.
pub fn n_checkpoints(&self) -> usize
[src]
Returns the number of checkpoints.
pub fn deltas(&self) -> &[f64]
[src]
Returns all deltas.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Timer
impl RefUnwindSafe for Timer
impl UnwindSafe for Timer
impl UnwindSafe for Timer