MCPcopy Create free account
hub / github.com/nodejs/node / clearTimeout

Function clearTimeout

deps/undici/src/lib/util/timers.js:351–363  ·  view source on GitHub ↗

* The clearTimeout method cancels an instantiated Timer previously created * by calling setTimeout. * * @param {NodeJS.Timeout|FastTimer} timeout

(timeout)

Source from the content-addressed store, hash-verified

349 * @param {NodeJS.Timeout|FastTimer} timeout
350 */
351 clearTimeout (timeout) {
352 // If the timeout is a FastTimer, call its own clear method.
353 if (timeout[kFastTimer]) {
354 /**
355 * @type {FastTimer}
356 */
357 timeout.clear()
358 // Otherwise it is an instance of a native NodeJS.Timeout, so call the
359 // Node.js native clearTimeout function.
360 } else {
361 clearTimeout(timeout)
362 }
363 },
364 /**
365 * The setFastTimeout() method sets a fastTimer which executes a function once
366 * the timer expires.

Callers 12

refreshTimeoutFunction · 0.70
resetFunction · 0.70
onAuthenticatedMethod · 0.50
onAuthenticationErrorMethod · 0.50
onConnectedMethod · 0.50
onConnectionErrorMethod · 0.50
clearHttp2IdleTimeoutFunction · 0.50
mockDispatchFunction · 0.50
#stopAutoFlushMethod · 0.50
destroyMethod · 0.50

Calls 1

clearMethod · 0.65

Tested by

no test coverage detected