FrameTiming class Null safety

Time-related performance metrics of a frame.

If you're using the whole Flutter framework, please use SchedulerBinding.addTimingsCallback to get this. It's preferred over using PlatformDispatcher.onReportTimings directly because SchedulerBinding.addTimingsCallback allows multiple callbacks. If SchedulerBinding is unavailable, then see PlatformDispatcher.onReportTimings for how to get this.

The metrics in debug mode (flutter run without any flags) may be very different from those in profile and release modes due to the debug overhead. Therefore it's recommended to only monitor and analyze performance metrics in profile and release modes.

Constructors

FrameTiming({required int vsyncStart, required int buildStart, required int buildFinish, required int rasterStart, required int rasterFinish, required int rasterFinishWallTime, int layerCacheCount = 0, int layerCacheBytes = 0, int pictureCacheCount = 0, int pictureCacheBytes = 0, int frameNumber = -1})
Construct FrameTiming with raw timestamps in microseconds.
factory

Properties

buildDuration Duration
The duration to build the frame on the UI thread.
read-only
frameNumber int
The frame key associated with this frame measurement.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
layerCacheBytes int
The number of bytes of image data used to cache layers during the frame.
read-only
layerCacheCount int
The number of layers stored in the raster cache during the frame.
read-only
layerCacheMegabytes double
The number of megabytes of image data used to cache layers during the frame.
read-only
pictureCacheBytes int
The number of bytes of image data used to cache pictures during the frame.
read-only
pictureCacheCount int
The number of pictures stored in the raster cache during the frame.
read-only
pictureCacheMegabytes double
The number of megabytes of image data used to cache pictures during the frame.
read-only
rasterDuration Duration
The duration to rasterize the frame on the raster thread.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
totalSpan Duration
The timespan between vsync start and raster finish.
read-only
vsyncOverhead Duration
The duration between receiving the vsync signal and starting building the frame.
read-only

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
timestampInMicroseconds(FramePhase phase) int
This is a raw timestamp in microseconds from some epoch. The epoch in all FrameTiming is the same, but it may not match DateTime's epoch.
toString() String
A string representation of this object.
override

Operators

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