Timer

class Util.Timer()

This class represents a single time-delayed action.

Constructors


Constructors

Timer.constructor()
Return type

Timer

Methods

clear

Timer.clear()

Clears the pending action if it exists.

Return type

void

isIdle

Timer.isIdle(type)
Arguments
  • type (TimerIdleType()) – None

Returns true if no pending action exists and false otherwise.

Return type

boolean

set

Timer.set(delay, action)
Arguments
  • delay (number()) – The delay in milliseconds to pend the action.

  • action (function()) – The action to pend.

Sets a new delayed action. If one is already pending before this call is made, it gets cleared.

Return type

void

Timer.action()
Return type

void

waitForIdle

Timer.waitForIdle(type)
Arguments
  • type (TimerIdleType()) – None

Returns a promise that resolves when the timer becomes (or already is) idle.

Return type

Promise <void>