I think it will be more idiomatic to mark the profiling function like this
#[profile_fn]
fn fn_name<T>(param: T) {
// If a function is complex, profile a section.
#[profile_section]
{
// Optional: manually drop.
// Section automatically drops when going out of scope.
drop(inner);
}
}
This API looks like the profiling crate, and it looks more ergonomic to me.
I think it will be more idiomatic to mark the profiling function like this
This API looks like the profiling crate, and it looks more ergonomic to me.