Namespace: TimerUtils

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

QuickNav


PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

TimerUtils

Version:
  • 7.1.0
Since:
  • 4.1.0
Module:
  • ojtimerutils

Module usage

See JET Module Loading for an overview of module usage within JET.

Javascript Import Format
define(['ojs/ojtimerutils'], function(TimerUtils) {
 // Application should call API on TimerUtils 
})
Timing related utilities

Methods

(static) getTimer(timeout) → {Timer}

Get a Timer object with the given timeout in milliseconds. The Promise associated with the timer is resolved when the timeout window expires, or if the clear() function is called. This is useful for when code needs to be executed on timeout (setTimeout) and must handle cleanup tasks such as clearing BusyState when the timer expires or is canceled.
Parameters:
Name Type Description
timeout number The timeout value in milliseconds to wait before the promise is resolved.
Returns:
A Timer object which encapsulates the Promise that will be resolved once the timeout has been exceeded or cleared.
Type
Timer