@@ -5,13 +5,25 @@ use core::time::Duration;
5
5
6
6
/// Tracks elapsed time. Enters the finished state once `duration` is reached.
7
7
///
8
- /// Non repeating timers will stop tracking and stay in the finished state until reset.
9
- /// Repeating timers will only be in the finished state on each tick `duration` is reached or
10
- /// exceeded, and can still be reset at any given point.
8
+ /// Note that in order to advance the timer [`tick`](Timer::tick) **MUST** be called.
11
9
///
12
- /// Paused timers will not have elapsed time increased.
10
+ /// # Timer modes
13
11
///
14
- /// Note that in order to advance the timer [`tick`](Timer::tick) **MUST** be called.
12
+ /// There are two timer modes ([`TimerMode`]):
13
+ ///
14
+ /// - Non repeating timers will stop tracking and stay in the finished state until reset.
15
+ /// - Repeating timers will only be in the finished state on each tick `duration` is reached or
16
+ /// exceeded, and can still be reset at any given point.
17
+ ///
18
+ /// # Pausing timers
19
+ ///
20
+ /// You can pause a timer using [`Timer::pause`]. Paused timers will not have elapsed time increased.
21
+ ///
22
+ /// # Elapsing multiple times a frame
23
+ ///
24
+ /// Repeating timers might elapse multiple times per frame if the time is advanced by more than the timer duration.
25
+ /// You can check how many times a timer elapsed each tick with [`Timer::times_finished_this_tick`].
26
+ /// For non-repeating timers, this will always be 0 or 1.
15
27
#[ derive( Clone , Debug , Default , PartialEq , Eq ) ]
16
28
#[ cfg_attr( feature = "serialize" , derive( serde:: Deserialize , serde:: Serialize ) ) ]
17
29
#[ cfg_attr(
0 commit comments