Class: FPSTimer

THING.FPSTimer()

FPSTimer The FPS timer.

Constructor

new FPSTimer()

Control render's FPS(frame pre second), we can limited max FPS also.
Source:

Members

currentFrameCount :Number

Get the current total frame count since started.
Type:
  • Number
Source:
Example
// Print current frame count since started.
console.log(fpsTimer.currentFrameCount);

deltaTime :Number

Get the delta time(seconds) from previous frame.
Type:
  • Number
Source:
Example
// Print delta time(seconds) from previous frame.
console.log(fpsTimer.deltaTime);

elapsedTime :Number

Get the elapsed time(seconds) since started.
Type:
  • Number
Source:
Example
// Print elapsed time(seconds) since started.
console.log(fpsTimer.elapsedTime);

enableFpsCounter :Boolean

Enable/Disable fps counter.
Type:
  • Boolean
Source:
Example
// Disable the FPS counter, if we disable then we can not get the FPS Counter info
fpsTimer.enableFpsCounter = false;

fixedDeltaTime :Number

Get/Set fixed delta time in seconds.
Type:
  • Number
Source:

fpsCounter :Number

Get the FPS Counter.
Type:
  • Number
Source:
Example
// Print the current FPS counter
console.log(fpsTimer.fpsCounter);

maxFPS :Number

Get/Set the max FPS number, null indicates unlimited.
Type:
  • Number
Source:
Example
// Limited the max FPS to 30 fps
fpsTimer.maxFPS = 30;
// Unlimited the FPS
fpsTimer.maxFPS = null;