Module ark_api::profiler

source ·
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.

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 ark::profiler::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 ark::profiler::set_scopes_on(ark::profiler::is_active()); on each frame update, to allow ark-client to switch the module profiler on/off.

Macros

  • Automatically name the profiling scope based on function name.
  • Profile the current scope with the given name (unique in the parent scope).
  • Call at least once from your Module setup code to enable profiling using the puffin profiler.

Functions