From e0335c2229ba8e5e0be28c9c41c41e515ee0b63a Mon Sep 17 00:00:00 2001 From: Joy <51241057+maniwani@users.noreply.github.com> Date: Sun, 9 Jan 2022 13:40:44 -0800 Subject: [PATCH] updated diagnostics plugins to use raw time measurements --- crates/bevy_diagnostic/src/frame_time_diagnostics_plugin.rs | 5 +++-- crates/bevy_diagnostic/src/log_diagnostics_plugin.rs | 4 ++-- examples/ui/text_debug.rs | 2 +- examples/wasm/winit_wasm.rs | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/bevy_diagnostic/src/frame_time_diagnostics_plugin.rs b/crates/bevy_diagnostic/src/frame_time_diagnostics_plugin.rs index 2ff6f17af4f803..06f9ecba2c5c02 100644 --- a/crates/bevy_diagnostic/src/frame_time_diagnostics_plugin.rs +++ b/crates/bevy_diagnostic/src/frame_time_diagnostics_plugin.rs @@ -40,11 +40,12 @@ impl FrameTimeDiagnosticsPlugin { state.frame_count += 1.0; diagnostics.add_measurement(Self::FRAME_COUNT, state.frame_count); - if time.delta_seconds_f64() == 0.0 { + let frame_time = time.raw_delta_seconds_f64(); + if frame_time == 0.0 { return; } - diagnostics.add_measurement(Self::FRAME_TIME, time.delta_seconds_f64()); + diagnostics.add_measurement(Self::FRAME_TIME, frame_time); if let Some(fps) = diagnostics .get(Self::FRAME_TIME) .and_then(|frame_time_diagnostic| { diff --git a/crates/bevy_diagnostic/src/log_diagnostics_plugin.rs b/crates/bevy_diagnostic/src/log_diagnostics_plugin.rs index 571b050a1d877b..8f2a9c478aaf18 100644 --- a/crates/bevy_diagnostic/src/log_diagnostics_plugin.rs +++ b/crates/bevy_diagnostic/src/log_diagnostics_plugin.rs @@ -85,7 +85,7 @@ impl LogDiagnosticsPlugin { time: Res