[−][src]Function persil::trace
pub fn trace(category: impl AsRef<str>, event: impl AsRef<str>)
Starts tracing an event with the given category
and a name
.
This function will return a guard that will stop tracing if it gets dropped.
It will only trace events if the profiler
build feature is enabled.
If the features is disabled, trace
is just a no-op function.
Example
{ let _guard = persil::trace("Some", "Event"); some_time_intense_event(); } fn some_time_intense_event() { // ... }