pub struct Stopwatch { /* private fields */ }Expand description
Accumulating stopwatch.
ⓘ
let mut sw = oa::Stopwatch::new();
sw.start();
// ... work ...
sw.stop();
println!("{:.3}ms", sw.elapsed_ms());Implementations§
Source§impl Stopwatch
impl Stopwatch
Sourcepub fn elapsed(&self) -> Timestamp
pub fn elapsed(&self) -> Timestamp
Current elapsed duration (includes running segment if active).
Sourcepub fn elapsed_sec(&self) -> f64
pub fn elapsed_sec(&self) -> f64
Elapsed in seconds.
Sourcepub fn elapsed_ms(&self) -> f64
pub fn elapsed_ms(&self) -> f64
Elapsed in milliseconds.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
True while the stopwatch is running.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Stopwatch
impl Freeze for Stopwatch
impl Move for Stopwatch
impl RefUnwindSafe for Stopwatch
impl Send for Stopwatch
impl Sync for Stopwatch
impl Unpin for Stopwatch
impl UnsafeUnpin for Stopwatch
impl UnwindSafe for Stopwatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more