public class Timers
extends java.lang.Object
| Constructor and Description | 
|---|
| Timers() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | install(Scriptable scope)Initialize the "setTimeout" and "clearTimeout" functions on the specified scope. | 
| void | runAllTimers(Context cx,
            Scriptable scope)Execute all pending timers and microtasks, blocking the thread if we need to wait for any
 timers to time out. | 
public void install(Scriptable scope)
scope - the scope where the functions should be definedpublic void runAllTimers(Context cx, Scriptable scope) throws java.lang.InterruptedException
cx - The Context to use to execute microtasks and timer functionsscope - the global scopejava.lang.InterruptedException - if the thread is interrupted while sleeping