Log frame timings

This commit is contained in:
Nathan Sobo 2023-12-13 18:44:21 -07:00
parent 1e4a7e6ef1
commit c863227dc2
3 changed files with 13 additions and 1 deletions

View file

@ -209,8 +209,14 @@ impl AnyView {
) {
cx.with_absolute_element_offset(origin, |cx| {
let (layout_id, rendered_element) = (self.layout)(self, cx);
let start_time = std::time::Instant::now();
cx.compute_layout(layout_id, available_space);
let duration = start_time.elapsed();
println!("compute layout: {:?}", duration);
let start_time = std::time::Instant::now();
(self.paint)(self, rendered_element, cx);
let duration = start_time.elapsed();
println!("paint: {:?}", duration);
})
}
}