API Documentation

for 0.0.1
Show:

Timer Class

A timer is a time manager that gives the possibily to schedule a function every n ms.

Constructor

Timer

(
  • params
)

Parameters:

  • params Object

    Config parameters

    • interval Number

      the number of millisecond to wait before the next timer's fire

    • callback Function

      the function to fires every time the timer's interval is passed. Can be an anonymous fonction or not.

Example:

var myTimer = new Timer({interval: 200, callback: function(){
                //your code here
            } });
myTimer.start();

Item Index

Methods

off

()

Deactivate the component

on

()

Activate the component

reset

()

Resets the timer

setup

()

Setup the timer with the current time

start

()

Starts the timer

stop

()

Starts the timer

update

()

Updates the timer's state