Take the current accumulated pass timings and reset the timings for the current thread. Only applies when [`DefaultProfiler`] is used. # Panics Panics when any pass timing token is currently active.
()
| 225 | /// |
| 226 | /// Panics when any pass timing token is currently active. |
| 227 | pub fn take_current() -> PassTimes { |
| 228 | assert_eq!( |
| 229 | CURRENT_PASS.with(|p| p.get()), |
| 230 | Pass::None, |
| 231 | "Cannot take_current() on profiler while a pass is active" |
| 232 | ); |
| 233 | PASS_TIME.with(|rc| mem::take(&mut *rc.borrow_mut())) |
| 234 | } |
| 235 | |
| 236 | // Information about passes in a single thread. |
| 237 | thread_local! { |
no test coverage detected