PythonMonkey   v0.3.1 (dev)
Loading...
Searching...
No Matches
timers.js File Reference

Functions

function setTimeout (handler, delayMs=0,...args)
 
function clearTimeout (timeoutId)
 
 if (!globalThis.setTimeout) globalThis.setTimeout
 

Variables

const internalBinding = require('internal-binding')
 
 const
 
exports setTimeout = setTimeout
 
exports clearTimeout = clearTimeout
 

Detailed Description

Function Documentation

◆ clearTimeout()

function clearTimeout (   timeoutId)

Implement the clearTimeout global function

See also
https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout and
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-cleartimeout
Parameters
{number}timeoutId
Returns
{void}

◆ if()

if ( !globalThis.  setTimeout)

◆ setTimeout()

function setTimeout (   handler,
  delayMs = 0,
  args 
)

Implement the setTimeout global function

See also
https://developer.mozilla.org/en-US/docs/Web/API/setTimeout and
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
Parameters
{Function| string} handler
{number}delayMs timeout milliseconds, use value of 0 if this is omitted
{any[]}args additional arguments to be passed to the handler
Returns
{number} timeoutId

@type {Function}

Variable Documentation

◆ clearTimeout

exports clearTimeout = clearTimeout

◆ const

const
Initial value:
{
enqueueWithDelay,
cancelByTimeoutId
} = internalBinding('timers')
const internalBinding
Definition timers.js:6

◆ internalBinding

function declare internalBinding = require('internal-binding')

internal binding helper for the setTimeout global function

UNSAFE, does not perform argument type checks

Returns
timeoutId

internal binding helper for the clearTimeout global function

◆ setTimeout

exports setTimeout = setTimeout