macro_rules! profile_current_function {
() => { ... };
($category:expr) => { ... };
}Expand description
Profile the current function automatically
ยงExamples
use torsh_profiler::profile_current_function;
fn my_expensive_function(x: i32) -> i32 {
profile_current_function!();
// This function will be automatically profiled
x * x
}
fn my_computation(data: &[f32]) -> f32 {
profile_current_function!("computation");
// This function will be profiled under "computation" category
data.iter().sum()
}