Set the profiler for the current thread. Returns the old profiler.
(new_profiler: Box<dyn Profiler>)
| 135 | /// |
| 136 | /// Returns the old profiler. |
| 137 | pub fn set_thread_profiler(new_profiler: Box<dyn Profiler>) -> Box<dyn Profiler> { |
| 138 | PROFILER.with(|profiler| core::mem::replace(&mut *profiler.borrow_mut(), new_profiler)) |
| 139 | } |
| 140 | |
| 141 | /// Start timing `pass` as a child of the currently running pass, if any. |
| 142 | /// |