use bevy::{
diagnostic::{
Diagnostic, DiagnosticPath, Diagnostics, LogDiagnosticsPlugin, RegisterDiagnostic,
},
prelude::*,
};
fn main() {
App::new()
.add_plugins((
DefaultPlugins,
LogDiagnosticsPlugin::default(),
))
.register_diagnostic(Diagnostic::new(SYSTEM_ITERATION_COUNT).with_suffix(" iterations"))
.add_systems(Update, my_system)
.run();
}
const SYSTEM_ITERATION_COUNT: DiagnosticPath = DiagnosticPath::const_new("system_iteration_count");
fn my_system(mut diagnostics: Diagnostics) {
diagnostics.add_measurement(&SYSTEM_ITERATION_COUNT, || 10.0);
}