MCPcopy Create free account
hub / github.com/17cupsofcoffee/nova / new

Method new

src/time.rs:12–22  ·  view source on GitHub ↗
(tick_rate: f64)

Source from the content-addressed store, hash-verified

10
11impl 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();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected