Class: Timer

bu.time. Timer

A class that triggers TIMEOUT events at certain duration. Initially duration is set Infinity, so it never triggers any event.


new Timer( [opts])

Parameters:
Name Type Argument Description
opts Object <optional>

Object with options as properties:

  • duration : Duration in milliseconds. Default is Infinity, so never ends.
Source:
bu/time/timer.js

Extends

  • ol.Object

Methods


check()

Checks current setup and updates.

Source:
bu/time/timer.js

getDuration()

Return current duration.

Source:
bu/time/timer.js
Returns:

Duration in milliseconds.

Type
number

reset()

Restarts the execution if set up is ok. The same as start().

Source:
bu/time/timer.js

setDuration(duration)

Sets current duration.

Parameters:
Name Type Description
duration number

Duration in milliseconds.

Source:
bu/time/timer.js

setup(interval)

Setups the function with the given interval.

Parameters:
Name Type Description
interval number

Interval in milliseconds between each execution.

Source:
bu/time/timer.js

start()

Starts the execution if set up is ok.

Source:
bu/time/timer.js

started()

Returns if execution has started.

Source:
bu/time/timer.js
Returns:

True if started.

Type
boolean

stop()

Stops the execution.

Source:
bu/time/timer.js