mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Much more accurate cpu_usage timing (#3913)
`frame.info.cpu_usage` now includes time for tessellation and rendering, but excludes vsync and context switching.
This commit is contained in:
@@ -93,12 +93,6 @@ impl eframe::App for MyApp {
|
||||
.store(show_deferred_viewport, Ordering::Relaxed);
|
||||
});
|
||||
|
||||
{
|
||||
// Sleep a bit to emulate some work:
|
||||
puffin::profile_scope!("small_sleep");
|
||||
std::thread::sleep(std::time::Duration::from_millis(10));
|
||||
}
|
||||
|
||||
if self.show_immediate_viewport {
|
||||
ctx.show_viewport_immediate(
|
||||
egui::ViewportId::from_hash_of("immediate_viewport"),
|
||||
@@ -121,12 +115,6 @@ impl eframe::App for MyApp {
|
||||
// Tell parent viewport that we should not show next frame:
|
||||
self.show_immediate_viewport = false;
|
||||
}
|
||||
|
||||
{
|
||||
// Sleep a bit to emulate some work:
|
||||
puffin::profile_scope!("small_sleep");
|
||||
std::thread::sleep(std::time::Duration::from_millis(10));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -153,12 +141,6 @@ impl eframe::App for MyApp {
|
||||
// Tell parent to close us.
|
||||
show_deferred_viewport.store(false, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
{
|
||||
// Sleep a bit to emulate some work:
|
||||
puffin::profile_scope!("small_sleep");
|
||||
std::thread::sleep(std::time::Duration::from_millis(10));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user