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