fps method

double fps(
  1. [int average = 1]
)

Returns the FPS based on the frame times from onTimingsCallback.

Implementation

double fps([int average = 1]) {
  return _previousTimings.length *
      _maxFrames /
      _previousTimings.map((t) {
        return (t.totalSpan.inMicroseconds ~/ frameInterval.inMicroseconds) +
            1;
      }).fold(0, (a, b) => a + b);
}