Class: FrameTimer

html.FrameTimer

Class representing a frame timer that triggers in sync with the screen refresh rate.

new html.FrameTimer ()

Properties:
Name Type Description
fps number

(default: 60) How many times the timer should trigger per second.

repeat bool

(default: false) Whether the timer repeats itself.

running bool

(default: false) Whether the timer should be running.

Extends

Methods

Starts or restarts the timer.

Stops the timer.

Events

html.FrameTimer.event:timeout

Is triggered on timeout.

Name Type Description
now number

The current timestamp.

elapsed number

The amount of milliseconds elapsed since the previous timeout.