Class: TaskLooper

TaskLooper(task)

Run a task in a fixed period loop.

Constructor

new TaskLooper(task)

Build the looper with a function to invoke on a fixed period loop.
Parameters:
Name Type Description
task function the task function to invoke
Source:

Methods

getTask() → {function}

Get the task function to invoke on a fixed period loop.
Source:
Returns:
the task function
Type
function

isStarted() → {boolean}

Indicates if looping.
Source:
Returns:
true if looping, false otherwise
Type
boolean

setPeriodInMs(periodInMs)

Set the loop period in milliseconds.
Parameters:
Name Type Description
periodInMs int the loop period in milliseconds
Source:

start(periodInMs) → {TaskLooper}

Start the task loop.
Parameters:
Name Type Description
periodInMs int the loop period in milliseconds
Source:
Returns:
this class for chaining
Type
TaskLooper

stop()

Stop the task loop.
Source: