PythonMonkey: python/pythonmonkey/builtin_modules/timers.js File Reference

Functions

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

Variables

const internalBinding = require('internal-binding')
 
 const
 
const clearImmediate = clearTimeout
 
const clearInterval = clearTimeout
 
setTimeout Timeout = Timeout
 
exports setTimeout = setTimeout
 
exports clearTimeout = clearTimeout
 
exports setImmediate = setImmediate
 
exports setInterval = setInterval
 
Date
May 2023
Copyright
Copyright (c) 2023 Distributive Corp.

◆ _normalizeTimerArgs()

function _normalizeTimerArgs (   handler,
  delayMs,
  additionalArgs 
)

Normalize the arguments to setTimeout,setImmediate or setInterval

Parameters
{Function| string} handler
{number}delayMs timeout milliseconds
{any[]}additionalArgs additional arguments to be passed to the handler

@type {Function}

◆ clearTimeout()

function clearTimeout (   timeoutId)

◆ if()

if ( !globalThis.  setTimeout)

◆ setImmediate()

function setImmediate (   handler,
  args 
)

◆ setInterval()

function setInterval (   handler,
  delayMs = 0,
  args 
)

◆ setTimeout()

function setTimeout (   handler,
  delayMs = 0,
  args 
)

◆ clearImmediate

◆ clearInterval

◆ clearTimeout

exports clearTimeout = clearTimeout

◆ const

Initial value:

{

enqueueWithDelay,

cancelByTimeoutId,

timerHasRef,

timerAddRef,

timerRemoveRef,

const internalBinding

Definition timers.js:8

◆ internalBinding

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

internal binding helper for the setTimeout/setInterval global functions

UNSAFE, does not perform argument type checks

Parameters
repeatThe call is to setInterval if true
Returns
timeoutId

internal binding helper for the clearTimeout global function

internal binding helper for if a timer object has been ref'ed

internal binding helper for ref'ing the timer

internal binding helper for unref'ing the timer

Retrieve debug info inside the timer for the WTFPythonMonkey tool

Retrieve the debug info for all timers that are still ref'ed

◆ setImmediate

exports setImmediate = setImmediate

◆ setInterval

exports setInterval = setInterval

◆ setTimeout

exports setTimeout = setTimeout

◆ Timeout