debugCollect static method

AggregatedTimings debugCollect()

Returns timings collected since debugCollectionEnabled was set to true, since the previous debugCollect, or since the previous debugReset, whichever was last.

Resets the collected timings.

This is only meant to be used in non-release modes, typically in profile mode that provides timings close to release mode timings.

Implementation

static AggregatedTimings debugCollect() {
  if (kReleaseMode) {
    throw _createReleaseModeNotSupportedError();
  }
  if (!_collectionEnabled) {
    throw StateError('Timeline metric collection not enabled.');
  }
  final AggregatedTimings result = AggregatedTimings(_buffer.computeTimings());
  debugReset();
  return result;
}