Class: Scheduler

Scheduler

Schedules functions to occur at a given time in the future, relative to the start time. Can be used to play music in realtime.

Constructor

new Scheduler()

Source:

Methods

at(time, callback)

Schedule a callback to run. Note, you may call this repeatedly with the same time parameter. It will append to any existing callbacks.

Parameters:
Name Type Description
time Number

Time in milliseconds, relative to when scheduler.start() is called.

callback function

The code to execute at the scheduled time.

Source:

clear()

Delete all scheduled callbacks

Source:

start()

Run the scheduler and execute the callbacks as scheduled.

Source:

stop()

Stop the scheduler.

Source: