From 5c1ce0597ff76072a1810db5f22425b42b23febe Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 7 Dec 2019 23:48:25 -0800 Subject: [PATCH] average frame time --- examples/simple.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/examples/simple.rs b/examples/simple.rs index 8119569f5a..04c2ed5d70 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -1,6 +1,7 @@ use bevy::*; use bevy::{render::*, asset::{Asset, AssetStorage, Handle}, math::{Mat4, Quat, Vec3}, Schedulable, Parent}; use rand::{rngs::StdRng, Rng, SeedableRng, random}; +use std::collections::VecDeque; fn build_wander_system() -> Box { let mut rng = StdRng::from_entropy(); @@ -73,6 +74,10 @@ fn build_move_system() -> Box { fn build_print_status_system() -> Box { let mut elapsed = 0.0; + let mut frame_time_total = 0.0; + let mut frame_time_count = 0; + let mut frame_time_max = 10; + let mut frame_time_values = VecDeque::new(); SystemBuilder::new("PrintStatus") .read_resource::