(tick_rate: f64)
| 10 | |
| 11 | impl Timer { |
| 12 | pub fn new(tick_rate: f64) -> Timer { |
| 13 | let target_time = Duration::from_secs_f64(1.0 / tick_rate); |
| 14 | |
| 15 | Timer { |
| 16 | start_time: Instant::now(), |
| 17 | last_time: Instant::now(), |
| 18 | accumulated_time: Duration::ZERO, |
| 19 | target_time, |
| 20 | max_lag: target_time * 8, |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | pub fn tick(&mut self) { |
| 25 | self.advance_time(); |
nothing calls this directly
no outgoing calls
no test coverage detected