Timer

class Communicator.Util.Timer()

This class represents a single time-delayed action.


Methods

clear

Timer.clear()

Clears the pending action if it exists.

Return type

void

isIdle

Timer.isIdle(type)

Returns true if no pending action exists and false otherwise.

Arguments
Return type

boolean

set

Timer.set(delay, action)

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

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

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

Return type

void

Timer.action()
Return type

void

waitForIdle

Timer.waitForIdle(type)

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

Arguments
Return type

Promise <void>