Skip to content

Commit 1f2aee7

Browse files
authored
Document pathological 60 Hz problem Time<Fixed>
1 parent 1d7ccbb commit 1f2aee7

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

crates/bevy_time/src/fixed.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ use crate::{time::Time, virt::Virtual, FixedUpdate};
1515
/// generic [`Time`] resource during [`FixedUpdate`](bevy_app::FixedUpdate)
1616
/// schedule processing.
1717
///
18-
/// The fixed timestep clock advances in fixed-size increments, which is extremely useful for
19-
/// writing logic (like physics) that should have consistent behavior, regardless of framerate.
18+
/// The fixed timestep clock advances in fixed-size increments, which is
19+
/// extremely useful for writing logic (like physics) that should have
20+
/// consistent behavior, regardless of framerate.
2021
///
2122
/// The default [`timestep()`](Time::timestep) is 64 hertz, or 15625
22-
/// microseconds. This value was chosen for being a power of two,
23-
/// which losslessly convert into [`f32`] and [`f64`], while only being
24-
/// slightly above 60 hertz (a standard screen refresh rate that is
25-
/// the de-facto performance target for many games).
23+
/// microseconds. This value was chosen because using 60 hertz has the potential
24+
/// for a pathological interaction with the monitor refresh rate where the game
25+
/// alternates between running two fixed timesteps and zero fixed timesteps per
26+
/// frame (for example when running two fixed timesteps takes longer than a
27+
/// frame). Additionally, the value is a power of two which losslessly converts
28+
/// into [`f32`] and [`f64`].
2629
///
2730
/// To run a system on a fixed timestep, add it to the
2831
/// [`FixedUpdate`](bevy_app::FixedUpdate) schedule. This schedule is run a

0 commit comments

Comments
 (0)