mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Add more puffin profile scopes to eframe (#3330)
* Add puffin profile scopes to the startup and running of eframe * puffin_profiler example: start puffin right away * cargo format let-else statements * More profile scopes * Add some `#[inline]` * Standardize puffin profile scope definitions * standardize again * Silence warning when puffin is disabled
This commit is contained in:
@@ -324,7 +324,6 @@ pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
mod profiling_scopes {
|
||||
#![allow(unused_macros)]
|
||||
#![allow(unused_imports)]
|
||||
@@ -333,6 +332,7 @@ mod profiling_scopes {
|
||||
macro_rules! profile_function {
|
||||
($($arg: tt)*) => {
|
||||
#[cfg(feature = "puffin")]
|
||||
#[cfg(not(target_arch = "wasm32"))] // Disabled on web because of the coarse 1ms clock resolution there.
|
||||
puffin::profile_function!($($arg)*);
|
||||
};
|
||||
}
|
||||
@@ -342,11 +342,12 @@ mod profiling_scopes {
|
||||
macro_rules! profile_scope {
|
||||
($($arg: tt)*) => {
|
||||
#[cfg(feature = "puffin")]
|
||||
#[cfg(not(target_arch = "wasm32"))] // Disabled on web because of the coarse 1ms clock resolution there.
|
||||
puffin::profile_scope!($($arg)*);
|
||||
};
|
||||
}
|
||||
pub(crate) use profile_scope;
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[allow(unused_imports)]
|
||||
pub(crate) use profiling_scopes::*;
|
||||
|
||||
Reference in New Issue
Block a user