+ frame_cnt += 1;
+ let now = Instant::now();
+ if now - last_report_time > Duration::from_secs(10) {
+ let fps = (frame_cnt - last_report_frame_cnt) as f32 /
+ (now - last_report_time).as_secs() as f32;
+ println!("fps={}", fps);
+ last_report_time = now;
+ last_report_frame_cnt = frame_cnt;
+ }
+