Class: StatsDisplay

StatsDisplay

new StatsDisplay()

Creates a new StatsDisplay object. Use this class to create a field in the top-left corner that displays the current frames per second and total number of elements processed in the System.animLoop. Note: StatsDisplay will not function in browsers whose Date object does not support Date.now(). These include IE6, IE7, and IE8.
Source:

Members

<private> _active

Set to false to stop requesting animation frames.
Source:

<private> _fps

Frames per second.
Source:

<private> _fpsValue

A reference to the textNode displaying the frame per second.
Source:

<private> _frameCount

Holds the total number of frames between seconds.
Source:

<private> _time

The current time.
Source:

<private> _timeLastFrame

The time at the last frame.
Source:

<private> _timeLastSecond

The time the last second was sampled.
Source:

<private> _totalElementsValue

A reference to the textNode displaying the total number of elements.
Source:

<private> el

A reference to the DOM element containing the display.
Source:

Methods

<private> _update()

If 1000ms have elapsed since the last evaluated second, _fps is assigned the total number of frames rendered and its corresponding textNode is updated. The total number of elements is also updated. This function is called again via requestAnimFrame().
Source:

destroy()

Removes statsDisplay from DOM.
Source:

getFPS() → {number}

Returns the current frames per second value.
Source:
Returns:
Frame per second.
Type
number