bevy/crates/bevy_time/src
Lenchog 8e14d99fb9
Added finish method for timer (#20154)
# Objective

- Add an easy way to finish a Timer

## Solution

- Tick the timer by the remaining time

## Testing

I have not tested, but it should work
---

## Showcase

```rust
let mut timer = Timer::from_seconds(1.5, TimerMode::Once);
timer.finish();
assert_eq!(timer.remaining(), Duration::from_secs(0))
```

---------

Co-authored-by: Jan Hohenheim <jan@hohenheim.ch>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2025-07-15 22:57:57 +00:00
..
common_conditions.rs Rename Timer::finished and Timer::paused to is_finished and is_paused (#19386) 2025-05-27 22:24:18 +00:00
fixed.rs Adopt consistent FooSystems naming convention for system sets (#18900) 2025-05-06 15:18:03 +00:00
lib.rs Split BufferedEvent from Event (#20101) 2025-07-14 21:31:48 +00:00
real.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
stopwatch.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
time.rs Split BufferedEvent from Event (#20101) 2025-07-14 21:31:48 +00:00
timer.rs Added finish method for timer (#20154) 2025-07-15 22:57:57 +00:00
virt.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00