startPerformanceStatisticsCollection method

  1. @experimental
void startPerformanceStatisticsCollection(
  1. PerformanceStatisticsOptions options,
  2. PerformanceStatisticsListener listener
)

Starts collecting CPU/GPU render performance statistics with the given options, delivering each sampled snapshot to listener. Calling this while collection is already active stops that collection and starts a new one with options and listener.

The map delivers a snapshot at the end of the first rendered frame after PerformanceStatisticsOptions.samplingDurationMillis has elapsed. A map that does not render delivers no snapshots.

Platform differences:

Throws an ArgumentError if PerformanceStatisticsOptions.samplingDurationMillis is negative.

Implementation

@experimental
void startPerformanceStatisticsCollection(
  PerformanceStatisticsOptions options,
  PerformanceStatisticsListener listener,
) {
  if (options.samplingDurationMillis < 0) {
    throw ArgumentError.value(
      options.samplingDurationMillis,
      'options.samplingDurationMillis',
      'Must not be negative',
    );
  }
  _impl.startPerformanceStatisticsCollection(options, listener);
}