Enum amethyst::Stopwatch
[−]
[src]
pub enum Stopwatch { Waiting, Started(Duration, Instant), Ended(Duration), }
A stopwatch which accurately measures elapsed time.
Variants
Waiting
Initial state with an elapsed time value of 0 seconds.
Started(Duration, Instant)
Stopwatch has started counting the elapsed time since this Instant
and accumuluated time from previous start/stop cycles Duration
.
Ended(Duration)
Stopwatch has been stopped and reports the elapsed time Duration
.
Methods
impl Stopwatch
[src]
fn new() -> Stopwatch
Creates a new stopwatch.
fn elapsed(&self) -> Duration
Retrieves the elapsed time.
fn restart(&mut self)
Stops, resets, and starts the stopwatch again.
fn start(&mut self)
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.
fn stop(&mut self)
Stops measuring elapsed time.
Note: Stopping a stopwatch that isn't running will do nothing.
fn reset(&mut self)
Clears the current elapsed time value.
Trait Implementations
impl PartialEq for Stopwatch
[src]
fn eq(&self, __arg_0: &Stopwatch) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Stopwatch) -> bool
This method tests for !=
.