Expand description
This crate provides timer types for measuring time in a program in different ways.
Elapsedis a timer that counts up and knows how much time has passed since it was started.Timeris a timer that counts down from its setDurationand knows how much time it has left.Stopwatchis a timer that counts up and can be paused and resumed.
In addition to the timer types, a collection type, TimedList, is provided,
which associates each element with a Duration and only retains elements whose Duration has not elapsed.
By default, this crate us f32 as the number type when dealing with seconds.
You can enable the f64 feature to use f64 for seconds instead.
Structs§
- Elapsed
- A simple timer that knows how long since it started
- Stopwatch
- A timer that can be paused and resumed.
- Timed
List - An iterable list structure where each element has an associated
Duration. - Timer
- A timer that counts down and knows when a
Durationhas elapsed
Traits§
- From
Duration - A trait for types that can be created from a
Duration - ToDuration
- A trait for types that can be turned into a
Duration
Functions§
- measure
- Measure the amount of time the given function takes to execute
Type Aliases§
- Seconds
- The type for a number of seconds