logo
Expand description

🚄 Profiler API

This provides bindings between the Puffin Profiler library and Ark.

Usage

In Cargo.toml:

  • Add "profiler" to the ark features list.
  • Add puffin = "0.4"

In your lib.rs you need a call require_profiler_api();. To enable profiling you need to call ark::setup_profiler!(); from your module entry point.

Now you can add profile scopes with puffin::profile_function!(); in functions you want to profile.

You should now be able to see your profile scopes in the ark-client profiler window.

It is also recommended that you call puffin::set_scopes_on(ark::profiler::is_active()); on each frame update, to allow ark-client to switch the module profiler on/off.

Macros

Call at least once from your Module setup code to enable profiling using the puffin profiler.

Functions

Is the module-side profiler on?

Current time in nanoseconds, from some unspecified event.

Report Puffin profiler event stream