endFrame method
Call this at the end of render().
Implementation
void endFrame({bool skipped = false}) {
if (!metricsOnlyFrame) {
_frameCount++;
if (skipped) {
_skippedFrames++;
}
}
if (_renderStopwatch != null) {
_renderStopwatch!.stop();
_lastRenderDuration = _renderStopwatch!.elapsed;
if (!metricsOnlyFrame) {
_renderTimes[_renderTimeIndex] = _lastRenderDuration;
_renderTimeIndex = (_renderTimeIndex + 1) % _sampleSize;
_renderTimeCount++;
}
}
// Auto-reset so callers don't need to remember to clear it.
metricsOnlyFrame = false;
}