diff options
author | eug-vs <eugene@eug-vs.xyz> | 2021-10-27 22:01:04 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2021-10-27 22:01:04 +0300 |
commit | 28b63fcbbbdc6a1b7ba50ef2f6734b060a735c8c (patch) | |
tree | bb6240175114bcdf1f4c74f24a46edbf8fce4006 | |
parent | 47f76ad2898ca5f0f1f94c2b5d9e08db5613187b (diff) | |
download | pistol-28b63fcbbbdc6a1b7ba50ef2f6734b060a735c8c.tar.gz |
feat: display FPS
-rw-r--r-- | src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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)); |