Enum amethyst_core::timing::Stopwatch[][src]

pub enum Stopwatch {
    Waiting,
    Started(DurationInstant),
    Ended(Duration),
}

A stopwatch which accurately measures elapsed time.

Variants

Initial state with an elapsed time value of 0 seconds.

Stopwatch has started counting the elapsed time since this Instant and accumuluated time from previous start/stop cycles Duration.

Stopwatch has been stopped and reports the elapsed time Duration.

Methods

impl Stopwatch
[src]

Creates a new stopwatch.

Retrieves the elapsed time.

Stops, resets, and starts the stopwatch again.

Starts, or resumes, measuring elapsed time. If the stopwatch has been started and stopped before, the new results are compounded onto the existing elapsed time value.

Note: Starting an already running stopwatch will do nothing.

Stops measuring elapsed time.

Note: Stopping a stopwatch that isn't running will do nothing.

Clears the current elapsed time value.

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. Read more

impl Eq for Stopwatch
[src]

impl PartialEq for Stopwatch
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for Stopwatch
[src]

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

Auto Trait Implementations

impl Send for Stopwatch

impl Sync for Stopwatch