pub fn set_trace_enabled(enabled: bool) -> boolExpand description
Enables or disables profiler trace collection at runtime.
When transitioning from enabled to disabled, add_task_timing becomes
cheaper since only cheap statistics are gathered. The existing per-thread
task buffers and the frame-event buffer are cleared so stale data isn’t
reported after a later re-enable. Active trace scopes keep collection enabled
until the last scope ends. Calls with the current setting are a no-op.