diagnostics: break out a variable to make this code cleaner
This commit is contained in:
@@ -44,8 +44,11 @@ impl Diagnostics {
|
|||||||
let render_prep_time = self.time_prepping_render.as_secs_f64();
|
let render_prep_time = self.time_prepping_render.as_secs_f64();
|
||||||
let stim_block_time = self.time_blocked_on_stim.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 render_block_time = self.time_blocked_on_render.as_secs_f64();
|
||||||
|
|
||||||
let overall_time = self.start_time.elapsed().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;
|
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)",
|
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,
|
fps,
|
||||||
step_time,
|
step_time,
|
||||||
@@ -54,7 +57,7 @@ impl Diagnostics {
|
|||||||
stim_block_time,
|
stim_block_time,
|
||||||
render_block_time,
|
render_block_time,
|
||||||
render_prep_time,
|
render_prep_time,
|
||||||
overall_time - step_time - stim_block_time - render_block_time - render_prep_time,
|
other_time,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user