[−][src]Struct puffin::ThreadProfiler
Collects profiling data for one thread
Implementations
impl ThreadProfiler
[src]
pub fn initialize(
now_ns: fn() -> NanoSecond,
reporter: fn(_: ThreadInfo, _: Stream)
)
[src]
now_ns: fn() -> NanoSecond,
reporter: fn(_: ThreadInfo, _: Stream)
)
Explicit initialize with custom callbacks.
If not called, each thread will use the default nanosecond source and report scopes to the global profiler.
For instance, when compiling for WASM the default timing function (puffin::now_ns
) won't work,
so you'll want to call puffin::ThreadProfiler::initialize(my_timing_function, puffin::global_reporter);
.
pub fn begin_scope(&mut self, id: &str, location: &str, data: &str) -> usize
[src]
Returns position where to write scope size once the scope is closed.
pub fn end_scope(&mut self, start_offset: usize)
[src]
pub fn call<R>(f: impl Fn(&mut Self) -> R) -> R
[src]
Do something with the thread local ThreadProfiler
Trait Implementations
impl Default for ThreadProfiler
[src]
Auto Trait Implementations
impl RefUnwindSafe for ThreadProfiler
impl Send for ThreadProfiler
impl Sync for ThreadProfiler
impl Unpin for ThreadProfiler
impl UnwindSafe for ThreadProfiler
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,