Timer constructor

Calling scheduleOnce() queues the timer to be called back once after the specified delay.

Syntax

Timer(func)
Timer(func, delay)

Parameters

Return value

A Timer object.

Example

> timer = new Timer(() => console.log("Fired!"));
undefined
> timer.scheduleOnce(2);
undefined
Fired!

References