RenderMetrics class final

Tracks render performance metrics including FPS, frame times, and render durations.

This class maintains a rolling window of frame samples to calculate accurate averages and detect performance issues.

Constructors

RenderMetrics({int sampleSize = 60})
Creates a new RenderMetrics instance.

Properties

averageFps → double
Average FPS over the sample window. Returns 0.0 when the application is idle (no real frames within the timeout window).
no setter
averageFrameTime → Duration
Average frame time over the sample window.
no setter
averageRenderDuration → Duration
Average render duration over the sample window.
no setter
currentFps → double
Current FPS based on the last frame time. Returns 0.0 when the application is idle (no real frames within the timeout window).
no setter
frameCount → int
Total number of frames rendered since creation or last reset.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isIdle → bool
Whether real (non-metrics-only) rendering is idle.
no setter
lastFrameTime → Duration
Duration of the last frame (time between renders).
no setter
lastRenderDuration → Duration
Duration of the last render() call.
no setter
maxFps → double
Maximum FPS in the sample window (fastest frame).
no setter
metricsOnlyFrame ↔ bool
When true, the next beginFrame/endFrame cycle is treated as a bookkeeping render (e.g. triggered by the metrics timer) and will not record inter-frame timing or increment the frame count. The flag is automatically reset at the end of endFrame.
getter/setter pair
minFps → double
Minimum FPS in the sample window (slowest frame).
no setter
renderTimePercentage → double
Percentage of time spent in render() vs total frame time.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
skippedFrames → int
Number of frames that were skipped (no changes to render).
no setter

Methods

beginFrame() → void
Call this at the start of each frame (before render).
endFrame({bool skipped = false}) → void
Call this at the end of render().
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets all metrics to initial state.
summary() → String
Returns a summary string of current metrics.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited