use crate::utils; pub struct Clock { perf: web_sys::Performance, start: f64, } impl Clock { pub fn new() -> Clock { let perf = utils::window() .performance() .expect("cannot access `window.performance`"); let start = perf.now(); Clock { perf, start } } pub fn frame_delta(&self) -> f32 { 0.1 } pub fn wall_time(&self) -> f64 { (self.perf.now() - self.start) / 1000.0 } }