mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-10-30 05:51:42 +00:00
Corrects typo in examples FrameCounter (#4725)
This commit is contained in:
parent
fd53ea90e6
commit
a827c1818b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user