Performance

Tracks performance stats of the game like fps, delta time, and frame number

Constructor

new Performance(Renderopt)

Creates a Performance object

Parameters:
NameTypeAttributesDescription
RenderRender<optional>

Render object to render performance stats to

Members

(readonly) fps :number

The frames per second of the engine.

Type:
  • number

(readonly) delta :number

The amount of time between frames in seconds.

Type:
  • number

(readonly) frame :number

How many frames the engine has simulated. Note that this will increase faster than the number of rendered frames when Engine.substeps is greater than 1.

Type:
  • number

render :PerformanceRender

PerformanceRender object for rendering performance stats such as the fps. Only created if Render is specified in the constructor.

Methods

update()

Updates the performance stats. Should be called once per frame. Called automatically by a Ticker.