oa::ScopedTimer

RAII scoped timer. Borrows a f64 and writes elapsed seconds on drop. ⓘlet mut elapsed = 0.0_f64; { let _t = oa::ScopedTimer::new(&mut elapsed); expensive_work(); } println!("took {elapsed:.3}s");

StRust public API

Declaration

pub struct ScopedTimer<'a> { /* private fields */ }
Public Rust declaration.

Public Methods

fn drop(&mut self)

Associated Functions

pub fn new(output: &'a mut f64) -> Self

Public Method Documentation

fn drop( &mut self )
No public source comment is attached to this declaration.
pub fn new( output: &'a mut f64 ) -> Self
No public source comment is attached to this declaration.