Timer

class Communicator.Util.Timer()

This class represents a single time-delayed action.

Methods

clear()

isIdle()

set()

waitForIdle()


Methods

clear

Communicator.Util.Timer.clear()

Clears the pending action if it exists.

Return type

void

isIdle

Communicator.Util.Timer.isIdle(type)

Returns true if no pending action exists and false otherwise.

Arguments
  • type (Communicator.Util.TimerIdleType()) –

Return type

boolean

set

Communicator.Util.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 ((): void()) – The action to pend.

Return type

void

waitForIdle

Communicator.Util.Timer.waitForIdle(type)

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

Arguments
  • type (Communicator.Util.TimerIdleType()) –

Return type

Promise[void]