cpu.rs: Double max IPF in dynamic timing by only getting the time once

This commit is contained in:
John 2023-04-02 14:48:34 -05:00
parent 03a6934a59
commit 93bbf67433

View File

@ -507,8 +507,9 @@ impl CPU {
}; };
// Convert the elapsed time to 60ths of a second // Convert the elapsed time to 60ths of a second
let time = self.timers.frame.elapsed().as_secs_f64() * 60.0; let frame = Instant::now();
self.timers.frame = Instant::now(); let time = (frame - self.timers.frame).as_secs_f64() * 60.0;
self.timers.frame = frame;
if time > 1.0 { if time > 1.0 {
self.flags.draw_wait = false; self.flags.draw_wait = false;
} }