Expand description
Profiling utilities for task, frame, and thread performance tracking. Timing for tasks, actions and window frames.
Recording is compiled in with the profiler feature. Without it, the functions
that return timings return empty results, and the recording functions do nothing.
Even with the feature, task and frame events in the trace buffers are kept only
while tracing is on; set_trace_enabled controls that state. The foreground journal,
which App::foreground_journal reads, records them regardless. With the feature, each
window also keeps its histograms, whether or not tracing is on.
To see frame times on screen, set the debug frame overlay mode with
Window::set_debug_frame_overlay_mode. To read the numbers in code, call
Window::frame_duration_snapshot and Window::input_latency_snapshot. Those
three window methods exist only with the profiler feature. The
performance guide walks through them.
Structs§
- Serialized
Location - Serializable variant of
core::panic::Location - Serialized
Task Timing - Serializable variant of [
TaskTiming] - Serialized
Thread Task Timings - Serializable variant of [
ThreadTaskTimings]
Functions§
- set_
trace_ enabled - Turns trace collection on or off, and returns
trueif the setting changed. - trace_
enabled - Returns
truewhile trace collection is on, either fromset_trace_enabledor from an active trace scope.