Class: FPSCounter

FPSCounter

A utility class to keep track of teh frame rate. It keeps a running average for the last few frames.


new FPSCounter(numFrames)

Parameters:
Name Type Description
numFrames

The amount of frames to average.

Author:
  • derschmale <http://www.derschmale.com>

Members


averageFPS

Returns the running average fps.


lastFrameFPS

Returns the last frame's fps.


maxFPS

Returns the maximum fps since last reset.


minFPS

Returns the minimum fps since last reset.

Methods


reset()

Resets minimum and maximum fps stats.


update(dt)

Updates the counter with a new frame time

Parameters:
Name Type Description
dt

The time in milliseconds since the last frame