From 28b63fcbbbdc6a1b7ba50ef2f6734b060a735c8c Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 27 Oct 2021 22:01:04 +0300 Subject: feat: display FPS --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7226c8e..8f11bdd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,7 +34,7 @@ fn main() { let timestamp = Instant::now(); cam.render(); addstr(&cam.buffer.to_string()); - addstr(&format!("\nRendered in {:?}\n", timestamp.elapsed()).to_string()); + addstr(&format!("\nRendered in {:?} ({:.0} FPS)\n", timestamp.elapsed(), 1.0 / timestamp.elapsed().as_secs_f64())); addstr(&format!("Camera: {:?}\n", cam.position)); addstr(&format!("Facing: {:?}\n", cam.direction)); addstr(&format!("Light: {:?}\n", cam.light)); -- cgit v1.2.3