1786005842

This commit is contained in:
2026-08-06 10:44:02 +02:00
parent 1c4e97dbaf
commit 71c7bbce16

View File

@@ -40,6 +40,11 @@ impl Trekstor {
self.input.handle_event();
self.current_time = Instant::now();
let dt = self.current_time - self.last_time;
self.last_time = self.current_time;
if dt < self.update_timestep {
sleep(self.update_timestep - dt);
}
println!("FPS: {}", 1.0 / dt.as_secs_f64());
@@ -49,11 +54,6 @@ impl Trekstor {
self.screen.flush();
self.input.finish();
if dt <= self.update_timestep {
sleep(self.update_timestep - dt);
}
self.last_time = self.current_time;
}
}
}