diff --git a/examples/common/src/framework.rs b/examples/common/src/framework.rs index d39da341e6..09f02acab5 100644 --- a/examples/common/src/framework.rs +++ b/examples/common/src/framework.rs @@ -342,11 +342,11 @@ impl FrameCounter { fn update(&mut self) { self.frame_count += 1; let new_instant = web_time::Instant::now(); - let elasped_secs = (new_instant - self.last_printed_instant).as_secs_f32(); - if elasped_secs > 1.0 { - let elapsed_ms = elasped_secs * 1000.0; + let elapsed_secs = (new_instant - self.last_printed_instant).as_secs_f32(); + if elapsed_secs > 1.0 { + let elapsed_ms = elapsed_secs * 1000.0; let frame_time = elapsed_ms / self.frame_count as f32; - let fps = self.frame_count as f32 / elasped_secs; + let fps = self.frame_count as f32 / elapsed_secs; log::info!("Frame time {:.2}ms ({:.1} FPS)", frame_time, fps); self.last_printed_instant = new_instant;