mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-16 00:03:29 +00:00
Monitor framerate
This commit is contained in:
+12
-1
@@ -12,7 +12,13 @@ fn main() {
|
||||
|
||||
App::new()
|
||||
.add_plugins((DefaultPlugins, OrbitCamPlugin, TestScenePlugin))
|
||||
.add_systems(Update, draw_world_axes.after(orbit_cam::pan_orbit_camera))
|
||||
.add_systems(
|
||||
Update,
|
||||
(
|
||||
draw_world_axes.after(orbit_cam::pan_orbit_camera),
|
||||
report_framerate,
|
||||
),
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
@@ -28,3 +34,8 @@ fn draw_world_axes(mut gizmos: Gizmos, q: Query<&OrbitCam>) {
|
||||
draw_axis(Vec3::Y, Color::GREEN);
|
||||
draw_axis(Vec3::Z, Color::BLUE);
|
||||
}
|
||||
|
||||
fn report_framerate(time: Res<Time>) {
|
||||
let ms = time.delta().as_micros() as f32 / 1000.0;
|
||||
info!("{:.2} fps", 1000.0 / ms);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user