diagnostics: break out a variable to make this code cleaner

This commit is contained in:
2022-08-21 18:12:31 -07:00
parent 850a7e773f
commit a414bd77d4

View File

@@ -44,8 +44,11 @@ impl Diagnostics {
let render_prep_time = self.time_prepping_render.as_secs_f64();
let stim_block_time = self.time_blocked_on_stim.as_secs_f64();
let render_block_time = self.time_blocked_on_render.as_secs_f64();
let overall_time = self.start_time.elapsed().as_secs_f64();
let other_time = overall_time - step_time - stim_block_time - render_block_time - render_prep_time;
let fps = (self.frames_completed as f64) / overall_time;
format!("fps: {:6.2} (step: {:.1}s, [stim: {:.1}s render: {:.1}s], blocked: (stim: {:.1}s render: {:.1}s), render_prep: {:.1}s, other: {:.1}s)",
fps,
step_time,
@@ -54,7 +57,7 @@ impl Diagnostics {
stim_block_time,
render_block_time,
render_prep_time,
overall_time - step_time - stim_block_time - render_block_time - render_prep_time,
other_time,
)
}
}