Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

McSpidey
Copy link
Contributor

@McSpidey McSpidey commented Aug 2, 2022

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: Alice Cecile <alice.i.cecile@gmail.com>
@alice-i-cecile alice-i-cecile added A-Diagnostics Logging, crash handling, error reporting and performance analysis C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Aug 2, 2022
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
@mockersf mockersf added the M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Aug 2, 2022
Copy link
Member

@mockersf mockersf left a 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

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,
);

@mockersf
Copy link
Member

mockersf commented Aug 2, 2022

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

@McSpidey
Copy link
Contributor Author

McSpidey commented Aug 2, 2022

Unreal and Unity both use milliseconds for frametimes.
https://docs.unrealengine.com/4.27/en-US/TestingAndOptimization/PerformanceAndProfiling/Overview/
https://docs.unity3d.com/Manual/ProfilerCPU.html

@mockersf
Copy link
Member

mockersf commented Aug 3, 2022

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>
Copy link
Member

@cart cart left a 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.

@cart
Copy link
Member

cart commented Aug 4, 2022

bors r+

@cart
Copy link
Member

cart commented Aug 4, 2022

bors r-

@bors
Copy link
Contributor

bors bot commented Aug 4, 2022

Canceled.

@cart
Copy link
Member

cart commented Aug 4, 2022

bors r+

bors bot pushed a commit that referenced this pull request Aug 4, 2022
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>
@bors bors bot changed the title changed diagnostics from seconds to milliseconds [Merged by Bors] - changed diagnostics from seconds to milliseconds Aug 4, 2022
@bors bors bot closed this Aug 4, 2022
maccesch pushed a commit to Synphonyte/bevy that referenced this pull request Aug 5, 2022
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>
inodentry pushed a commit to BroovyJammy/bevy that referenced this pull request Aug 19, 2022
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>
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
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>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants