Crate puffin

source ·
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();
        }

    }
}

Re-exports

  • pub use utils::clean_function_name;
  • pub use utils::short_file_name;
  • pub use utils::type_name_of;

Macros

  • 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

Enums

  • TODO: Improve encapsulation. Errors that can happen when parsing a Stream of profile data.
  • Scopes are identified by user-provided name while functions are identified by the function name.

Functions

Type Aliases