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_captureandstop_capture, in the order they started. - Scope
- RAII guard returned by
scope. The scope ends when the guard is dropped. - Scope
Record - A single recorded scope.
Constants§
- ENABLED
- Whether the profiler is compiled in (the
profilingfeature 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.