recordFrame static method

void recordFrame()

Record frame time for performance monitoring

Implementation

static void recordFrame() {
  final DateTime now = DateTime.now();
  if (_lastFrameTime != null) {
    final Duration frameTime = now.difference(_lastFrameTime!);
    _frameTimes.add(frameTime);

    // Keep only last 60 frames
    if (_frameTimes.length > 60) {
      _frameTimes.removeAt(0);
    }
  }
  _lastFrameTime = now;
}