Add a frame timer
This commit is contained in:
@@ -6,6 +6,7 @@ extern crate load_file;
|
||||
|
||||
use glium::texture::SrgbTexture2d;
|
||||
use std::io::Cursor;
|
||||
use std::time::Instant;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glium::{glutin, Surface};
|
||||
@@ -237,6 +238,7 @@ fn main() {
|
||||
};
|
||||
|
||||
// drawing a frame
|
||||
let start = Instant::now();
|
||||
let mut target = display.draw();
|
||||
target.clear_color_and_depth((0.0, 0.0, 0.0, 0.0), 1.0);
|
||||
target
|
||||
@@ -249,6 +251,8 @@ fn main() {
|
||||
)
|
||||
.unwrap();
|
||||
target.finish().unwrap();
|
||||
let duration = start.elapsed();
|
||||
println!("Time elapsed is: {:?}", duration);
|
||||
|
||||
let mut action = support::Action::Continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user