Introduce a ZED_MEASUREMENTS
env var and use it to measure frame time
This commit is contained in:
parent
10ca33ce02
commit
de64de22a3
3 changed files with 37 additions and 6 deletions
|
@ -34,7 +34,7 @@ use std::{
|
|||
Arc,
|
||||
},
|
||||
};
|
||||
use util::ResultExt;
|
||||
use util::{measure, ResultExt};
|
||||
|
||||
mod element_cx;
|
||||
pub use element_cx::*;
|
||||
|
@ -310,7 +310,9 @@ impl Window {
|
|||
platform_window.on_request_frame(Box::new({
|
||||
let mut cx = cx.to_async();
|
||||
move || {
|
||||
handle.update(&mut cx, |_, cx| cx.draw()).log_err();
|
||||
measure("frame duration", || {
|
||||
handle.update(&mut cx, |_, cx| cx.draw()).log_err();
|
||||
})
|
||||
}
|
||||
}));
|
||||
platform_window.on_resize(Box::new({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue