Module: vertx/timer

vertx/timer

Methods

<static> cancelTimer(id) → {boolean}

Cancels a timer.
Parameters:
Name Type Description
id TimerId the id of the timer, as returned from set_timer or set_periodic
Source:
Returns:
true if the timer was cancelled, false if it wasn't found.
Type
boolean

<static> setPeriodic(interval, handler) → {TimerId}

Set a periodic timer.
Parameters:
Name Type Description
interval number the period of the timer, in milliseconds
handler function an handler that will be called each time the timer fires
Source:
Returns:
the unique id of the timer
Type
TimerId

<static> setTimer(delay, handler) → {TimerId}

Sets a one-shot timer that will fire after a certain delay.
Parameters:
Name Type Description
delay number the delay, in milliseconds
handler function an handler that will be called when the timer fires
Source:
Returns:
the unique id of the timer
Type
TimerId