--- name: bevy-timers description: Reference for Bevy timers — Timer as resource, component, or Local; tick, is_finished/just_finished, TimerMode::Once vs Repeating. metadata: crate: bevy_time bevy: "0.19" --- ## Timer modes - `TimerMode::Once` — stays finished after reaching the end until reset manually - `TimerMode::Repeating` — auto-resets when it reaches the end Timers tick **up** from zero to their `Duration`. `is_finished` stays `true` after the tick that finished a `Once` timer, while `just_finished` is only `true` on that tick. For a `Repeating` timer the two are equivalent. A repeating timer can finish more than once per tick, so use `times_finished_this_tick` to know how many times it finished. ## Timer as resource ```rust #[derive(Resource)] struct MatchTime(Timer); impl Default for MatchTime { fn default() -> Self { Self(Timer::from_seconds(60.0, TimerMode::Once)) } } fn countdown(time: Res