-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - changed diagnostics from seconds to milliseconds #5554
Conversation
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also update the example accessing that diagnostic. It will make it slightly more complicated as now one of the source of truth is in milliseconds while the other is still in seconds
bevy/examples/ui/text_debug.rs
Lines 169 to 181 in a9cb18e
let mut frame_time = time.delta_seconds_f64(); | |
if let Some(frame_time_diagnostic) = diagnostics.get(FrameTimeDiagnosticsPlugin::FRAME_TIME) | |
{ | |
if let Some(frame_time_avg) = frame_time_diagnostic.average() { | |
frame_time = frame_time_avg; | |
} | |
} | |
text.sections[0].value = format!( | |
"This text changes in the bottom right - {:.1} fps, {:.3} ms/frame", | |
fps, | |
frame_time * 1000.0, | |
); |
As someone not accustomed to other game engine, seconds is the natural unit for a duration, not milliseconds. Very quick google search seems to show in seconds for unreal, not sure about unity |
Unreal and Unity both use milliseconds for frametimes. |
You're right, for displaying, milliseconds makes a lot more sense. I was looking for the unit used when accessing timings from code, for that I found seconds |
Co-authored-by: François <mockersf@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short term I think this makes sense. Long term we might want to do all unit conversions on the "display side" and store in the "base unit". But thats a conversation for another day.
bors r+ |
bors r- |
Canceled. |
bors r+ |
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> # Objective Change frametimediagnostic from seconds to milliseconds because this will always be less than one seconds and is the common diagnostic display unit for game engines. ## Solution - multiplied the existing value by 1000 --- ## Changelog Frametimes are now reported in milliseconds Co-authored-by: Syama Mishra <38512086+SyamaMishra@users.noreply.github.com> Co-authored-by: McSpidey <mcspidey@gmail.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Pull request successfully merged into main. Build succeeded: |
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> # Objective Change frametimediagnostic from seconds to milliseconds because this will always be less than one seconds and is the common diagnostic display unit for game engines. ## Solution - multiplied the existing value by 1000 --- ## Changelog Frametimes are now reported in milliseconds Co-authored-by: Syama Mishra <38512086+SyamaMishra@users.noreply.github.com> Co-authored-by: McSpidey <mcspidey@gmail.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> # Objective Change frametimediagnostic from seconds to milliseconds because this will always be less than one seconds and is the common diagnostic display unit for game engines. ## Solution - multiplied the existing value by 1000 --- ## Changelog Frametimes are now reported in milliseconds Co-authored-by: Syama Mishra <38512086+SyamaMishra@users.noreply.github.com> Co-authored-by: McSpidey <mcspidey@gmail.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> # Objective Change frametimediagnostic from seconds to milliseconds because this will always be less than one seconds and is the common diagnostic display unit for game engines. ## Solution - multiplied the existing value by 1000 --- ## Changelog Frametimes are now reported in milliseconds Co-authored-by: Syama Mishra <38512086+SyamaMishra@users.noreply.github.com> Co-authored-by: McSpidey <mcspidey@gmail.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> # Objective Change frametimediagnostic from seconds to milliseconds because this will always be less than one seconds and is the common diagnostic display unit for game engines. ## Solution - multiplied the existing value by 1000 --- ## Changelog Frametimes are now reported in milliseconds Co-authored-by: Syama Mishra <38512086+SyamaMishra@users.noreply.github.com> Co-authored-by: McSpidey <mcspidey@gmail.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Co-authored-by: Alice Cecile alice.i.cecile@gmail.com
Objective
Change frametimediagnostic from seconds to milliseconds because this will always be less than one seconds and is the common diagnostic display unit for game engines.
Solution
Changelog
Frametimes are now reported in milliseconds