Struct iota_lib_rs::utils::StopWatch [−][src]
pub struct StopWatch { /* fields omitted */ }
Provides a stopwatch for measuring how long things take... this might seem like a weird addition to the library, but it was in Jota...so I put it here. If no one uses this, I'll probably remove it later.
Methods
impl StopWatch
[src]
impl StopWatch
pub fn new() -> StopWatch
[src]
pub fn new() -> StopWatch
Creates a new stopwatch
pub fn restart(&mut self)
[src]
pub fn restart(&mut self)
Restarts the stopwatch
pub fn stop(self) -> Duration
[src]
pub fn stop(self) -> Duration
Stops the stopwatch and returns the duration
pub fn pause(&mut self)
[src]
pub fn pause(&mut self)
Pauses the stopwatch
pub fn resume(&mut self)
[src]
pub fn resume(&mut self)
Resumes the stopwatch
pub fn elapsed_time(&self) -> Duration
[src]
pub fn elapsed_time(&self) -> Duration
Returns the elapsed time so far
pub fn is_running(&self) -> bool
[src]
pub fn is_running(&self) -> bool
Checks whether the stopwatch is running
Trait Implementations
impl Copy for StopWatch
[src]
impl Copy for StopWatch
impl Clone for StopWatch
[src]
impl Clone for StopWatch
fn clone(&self) -> StopWatch
[src]
fn clone(&self) -> StopWatch
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for StopWatch
[src]
impl Debug for StopWatch
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for StopWatch
[src]
impl Default for StopWatch