UpdateFrameCount method

void UpdateFrameCount(
  1. double now, [
  2. String extra = ""
])

Implementation

void UpdateFrameCount(double now, [String extra = ""]) {
  _frames++;
  if ((now - _lastSample) < _SAMPLE_RATE_MS) return;
  double fps = _frames * 1000.0 / _SAMPLE_RATE_MS;
  //print("${fps}");
  _frames = 0;
  _lastSample = now;
  _text.text = fps.toStringAsFixed(2) + " fps";
  _extra.innerHtml = extra;
  AddRawValue(_graphHeight * fps.ceil() ~/ _maxFps);
}