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

added frame count to FrameTimeDiagnosticsPlugin #678

Merged
merged 5 commits into from
Oct 14, 2020

Conversation

Olaren15
Copy link
Contributor

see issue #193

@karroffel karroffel added C-Feature A new feature, making something new possible C-Performance A change motivated by improving speed, memory usage or compile times labels Oct 14, 2020
Copy link
Member

@joshuajbouw joshuajbouw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and simple enough to include to me. Good improvement.

.add_system(Self::diagnostic_system.system());
}
}

impl FrameTimeDiagnosticsPlugin {
pub const FPS: DiagnosticId = DiagnosticId::from_u128(288146834822086093791974408528866909483);
pub const FRAME_COUNT: DiagnosticId =
DiagnosticId::from_u128(54021991829115352065418785002088010277);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think id prefer a fully-random uuid just so these are more distinguishable when printed. I generated one for you :)

73441630925388532774622109383099159699

if time.delta_seconds_f64 == 0.0 {
return;
}

state.frame_count += 1.0;
diagnostics.add_measurement(Self::FRAME_COUNT, state.frame_count);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should probably move this above the time.delta_seconds_f64 == 0.0 check. A frame still happens even if the delta time is 0.

@cart cart merged commit 1f7fe77 into bevyengine:master Oct 14, 2020
joshuajbouw pushed a commit to joshuajbouw/bevy that referenced this pull request Oct 24, 2020
added frame count to FrameTimeDiagnosticsPlugin
@billyb2
Copy link
Contributor

billyb2 commented Sep 22, 2021

Just out of curiosity, why use an f64 instead of a u64 for the frame count (to avoid precision stuff)?

@mockersf
Copy link
Member

why use an f64 instead of a u64

All diagnostics are saved as f64 for add_measurement

@billyb2
Copy link
Contributor

billyb2 commented Sep 30, 2021

@mockersf oh okay, thank you

bors bot pushed a commit that referenced this pull request May 17, 2022
Original reasoning: #678 (comment)

That reasoning doesn't seem valid IMO since eventually +1 will do nothing. Using an integer is more intuitive and will wrap around which is probably better than getting stuck.
robtfm pushed a commit to robtfm/bevy that referenced this pull request May 17, 2022
Original reasoning: bevyengine#678 (comment)

That reasoning doesn't seem valid IMO since eventually +1 will do nothing. Using an integer is more intuitive and will wrap around which is probably better than getting stuck.
exjam pushed a commit to exjam/bevy that referenced this pull request May 22, 2022
Original reasoning: bevyengine#678 (comment)

That reasoning doesn't seem valid IMO since eventually +1 will do nothing. Using an integer is more intuitive and will wrap around which is probably better than getting stuck.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
Original reasoning: bevyengine#678 (comment)

That reasoning doesn't seem valid IMO since eventually +1 will do nothing. Using an integer is more intuitive and will wrap around which is probably better than getting stuck.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Feature A new feature, making something new possible C-Performance A change motivated by improving speed, memory usage or compile times
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants