mirror of
https://github.com/stickynotememo/wolf_renderer.git
synced 2026-07-30 06:46:03 +10:00
fps counter
This commit is contained in:
+1
-1
@@ -75,7 +75,7 @@ fn main() {
|
|||||||
let elapsed = now.elapsed(); // Timing operations
|
let elapsed = now.elapsed(); // Timing operations
|
||||||
dt += elapsed;
|
dt += elapsed;
|
||||||
let remaining = if Duration::from_secs_f64(UPDATE_LENGTH) > elapsed { Duration::from_secs_f64(UPDATE_LENGTH) - elapsed } else {
|
let remaining = if Duration::from_secs_f64(UPDATE_LENGTH) > elapsed { Duration::from_secs_f64(UPDATE_LENGTH) - elapsed } else {
|
||||||
eprintln!("fps < {FPS}");
|
eprintln!("fps: {}", 1.0 / (elapsed.as_secs_f64()));
|
||||||
Duration::ZERO
|
Duration::ZERO
|
||||||
};
|
};
|
||||||
thread::sleep(remaining);
|
thread::sleep(remaining);
|
||||||
|
|||||||
Reference in New Issue
Block a user