computeStandardDeviationFrameRasterizerTimeMillis method

double computeStandardDeviationFrameRasterizerTimeMillis()

Standard deviation amount of time spent per frame in the engine rasterizer.

Throws a StateError if this summary contains no timeline events.

Implementation

double computeStandardDeviationFrameRasterizerTimeMillis() {
  final List<Duration> durations = _extractGpuRasterizerDrawDurations();
  final double average = _averageInMillis(durations);
  double tally = 0.0;
  for (final Duration duration in durations) {
    final double time = duration.inMicroseconds.toDouble() / 1000.0;
    tally += (average - time).abs();
  }
  return tally / durations.length;
}