Skip to main content

Module profiling

Module profiling 

Source
Expand description

A lightweight profiler for the vizia update and draw pipeline.

Enable the profiling feature to compile it in. Without the feature every function here is a no-op, so the instrumentation in the systems costs nothing.

Each system opens a Scope while it runs, which records how long the system took. Recording only happens between start_capture and stop_capture. The returned Capture implements Display.

ⓘ
vizia::profiling::start_capture();
// ... trigger a state change and let the event loop process it ...
let capture = vizia::profiling::stop_capture();
println!("{capture}");

Structs§

Capture
The scopes recorded between start_capture and stop_capture, in the order they started.
Scope
RAII guard returned by scope. The scope ends when the guard is dropped.
ScopeRecord
A single recorded scope.

Constants§

ENABLED
Whether the profiler is compiled in (the profiling feature is enabled).

Functions§

is_capturing
Returns true if a capture is in progress on the current thread.
scope
Opens a profiling scope which lasts until the returned guard is dropped.
start_capture
Starts a new capture on the current thread, discarding any previously recorded scopes.
stop_capture
Stops the current capture and returns everything recorded since start_capture.