Crate puffin[][src]

Expand description

Usage:

fn main() {
    puffin::set_scopes_on(true); // you may want to control this with a flag

    // game loop
    loop {
        puffin::GlobalProfiler::lock().new_frame();

        {
            puffin::profile_scope!("slow_code");
            slow_code();
        }

    }
}

Macros

Returns a shortened path to the current file.

Returns the name of the calling function without a long module path prefix.

Automatically name the profiling scope based on function name.

Profile the current scope with the given name (unique in the parent scope).

Structs

One frame worth of profile data, collected from many sources.

Singleton. Collects profiling data from multiple threads.

An record of several sibling (or cousin) scopes.

Created by the puffin::profile*!(...) macros.

Parses a Stream of profiler data.

Used when parsing a Stream.

Used when parsing a Stream.

Stream of profiling events from one thread.

A Stream plus some info about it.

Used to identify one source of profiling data.

Collects profiling data for one thread

Enums

Errors that can happen when parsing a Stream of profile data.

Functions

Are the profiler scope macros turned on? This is false by default.

Report a stream of profile data from a thread to the GlobalProfiler singleton.

Merge sibling scopes with the same id.

Merge sibling scopes with the same id.

Returns monotonically increasing nanosecond count. It is undefined when now_ns()=0 is.

Turn on/off the profiler macros (profile_function, profile_scope etc). When off, these calls take only 1-2 ns to call (100x faster). This is false by default.

Type Definitions

All times are expressed as integer nanoseconds since some event.