Struct fine_grained::Stopwatch [] [src]

pub struct Stopwatch { /* fields omitted */ }

A stopwatch with lap functionality and nanosecond resolution.

Methods

impl Stopwatch
[src]

Initialize a new stopwatch without starting it.

Initialize a new stopwatch and start it.

Start the stopwatch.

Start a new lap. Save the last lap's time and return it.

If the stopwatch has not been started, the lap will not be saved and 0 will be returned.

Stop the stopwatch, without updating the total time.

This will not reset the stopwatch, i.e. the total time and the laps will be preserved.

Re-initialize the stopwatch without restarting it.

Re-initialize the stopwatch and start it.

Get the total time the stopwatch has been running.

If the stopwatch is still running, the total time is the time from starting the stopwatch until now. Otherwise, it is the sum of all laps.

Get the list of all measured lap times in the order the laps were timed.

Get the number of measured laps.

Determine if the stopwatch is currently running.

Trait Implementations

impl Clone for Stopwatch
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Stopwatch
[src]

Formats the value using the given formatter.

impl Default for Stopwatch
[src]

Returns the "default value" for a type. Read more

impl Display for Stopwatch
[src]

Formats the total time using the given formatter.