use std::time::Instant;
use crate::engine::Clock;
pub struct InstantClock {
now: Instant,
}
impl Default for InstantClock {
fn default() -> Self {
Self {
now: Instant::now(),
}
}
}
impl Clock for InstantClock {
fn now(&mut self) -> f32 {
self.now.elapsed().as_secs_f32()
}
}