Skip to content

Commit

Permalink
Corrects typo in examples FrameCounter (#4725)
Browse files Browse the repository at this point in the history
  • Loading branch information
cantudo authored Nov 19, 2023
1 parent fd53ea9 commit a827c18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/common/src/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a827c18

Please sign in to comment.