aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2021-10-27 22:01:04 +0300
committereug-vs <eugene@eug-vs.xyz>2021-10-27 22:01:04 +0300
commit28b63fcbbbdc6a1b7ba50ef2f6734b060a735c8c (patch)
treebb6240175114bcdf1f4c74f24a46edbf8fce4006
parent47f76ad2898ca5f0f1f94c2b5d9e08db5613187b (diff)
downloadpistol-28b63fcbbbdc6a1b7ba50ef2f6734b060a735c8c.tar.gz
feat: display FPS
-rw-r--r--src/main.rs2
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));