Class: FPSDisplay

FPSDisplay

new FPSDisplay()

Creates a new FPSDisplay object. Use this class to create a field at the top of the browser that displays the current frames per second and total number of elements in an optional passed array. Note: FPSDisplay will not function in browsers whose Date object does not support Date.now(). These include IE6, IE7, and IE8.
Source:

Members

<private, static> _frameCount :number

Holds the total number of frames between seconds.
Type:
  • number
Source:

<private, static> _time :number

The current time.
Type:
  • number
Source:

<private, static> _timeLastFrame :number

The time at the last frame.
Type:
  • number
Source:

<private, static> _timeLastSecond :number

The time the last second was sampled.
Type:
  • number
Source:

<static> active :boolean

Set to false to stop requesting animation frames.
Type:
  • boolean
Source:

<static> fps :number

Frames per second.
Type:
  • number
Source:

<static> name :string

Name
Type:
  • string
Source:

<static> totalItems :number

Total items.
Type:
  • number
Source:

<private> el

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

Methods

<static> hide()

Hides FPSDisplay from DOM.
Source:

<static> show()

Shows FPSDisplay from DOM.
Source:

<static> update()

Initializes the FPSDisplay.
Source:

<static> update(opt_totalItems)

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.
Parameters:
Name Type Argument Description
opt_totalItems Number <optional>
The total items in the system.
Source: