pub struct Stopwatch { /* private fields */ }Expand description
A simple stopwatch implementation.
Implementations§
source§impl Stopwatch
impl Stopwatch
sourcepub fn is_running(&mut self) -> bool
pub fn is_running(&mut self) -> bool
Returns true if the stopwatch is running, and false if not.
sourcepub fn elapsed_ms(&mut self) -> u128
pub fn elapsed_ms(&mut self) -> u128
Returns the total elapsed time in milliseconds.
sourcepub fn elapsed_us(&mut self) -> u128
pub fn elapsed_us(&mut self) -> u128
Returns the total elapsed time in microseconds.
sourcepub fn elapsed_ns(&mut self) -> u128
pub fn elapsed_ns(&mut self) -> u128
Returns the total elapsed time in nanoseconds.
sourcepub fn elapsed_s_whole(&self) -> u64
pub fn elapsed_s_whole(&self) -> u64
Returns the total elapsed time in whole seconds.
Trait Implementations§
source§impl Ord for Stopwatch
impl Ord for Stopwatch
source§impl PartialEq<Stopwatch> for Stopwatch
impl PartialEq<Stopwatch> for Stopwatch
source§impl PartialOrd<Stopwatch> for Stopwatch
impl PartialOrd<Stopwatch> for Stopwatch
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more