MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / take_current

Function take_current

cranelift/codegen/src/timing.rs:227–234  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

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! {

Callers 3

worker_threadFunction · 0.85
compile_functionMethod · 0.85
finish_compilingMethod · 0.85

Calls 1

withMethod · 0.45

Tested by

no test coverage detected