Skip to content

@ralphschuler.logger.animations.VerticalBarAnimation.<internal>.Timeout

github-actions edited this page Nov 26, 2023 · 1 revision

Class: Timeout

animations/VerticalBarAnimation.<internal>.Timeout

This object is created internally and is returned from setTimeout() and setInterval(). It can be passed to either clearTimeout() or clearInterval() in order to cancel the scheduled actions.

By default, when a timer is scheduled using either setTimeout() or setInterval(), the Node.js event loop will continue running as long as the timer is active. Each of the Timeout objects returned by these functions export both timeout.ref() and timeout.unref() functions that can be used to control this default behavior.

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new Timeout(): Timeout

Returns

Timeout

Methods

[dispose]

[dispose](): void

Cancels the timeout.

Returns

void

Since

v20.5.0

Defined in

node_modules/@types/node/timers.d.ts:130


[toPrimitive]

[toPrimitive](): number

Returns

number

Implementation of

Timer.[toPrimitive]

Defined in

node_modules/@types/node/timers.d.ts:125


hasRef

hasRef(): boolean

If true, the Timeout object will keep the Node.js event loop active.

Returns

boolean

Since

v11.0.0

Implementation of

Timer.hasRef

Defined in

node_modules/@types/node/timers.d.ts:112


ref

ref(): Timeout

When called, requests that the Node.js event loop not exit so long as theTimeout is active. Calling timeout.ref() multiple times will have no effect.

By default, all Timeout objects are "ref'ed", making it normally unnecessary to call timeout.ref() unless timeout.unref() had been called previously.

Returns

Timeout

a reference to timeout

Since

v0.9.1

Implementation of

Timer.ref

Defined in

node_modules/@types/node/timers.d.ts:99


refresh

refresh(): Timeout

Sets the timer's start time to the current time, and reschedules the timer to call its callback at the previously specified duration adjusted to the current time. This is useful for refreshing a timer without allocating a new JavaScript object.

Using this on a timer that has already called its callback will reactivate the timer.

Returns

Timeout

a reference to timeout

Since

v10.2.0

Implementation of

Timer.refresh

Defined in

node_modules/@types/node/timers.d.ts:124


unref

unref(): Timeout

When called, the active Timeout object will not require the Node.js event loop to remain active. If there is no other activity keeping the event loop running, the process may exit before the Timeout object's callback is invoked. Callingtimeout.unref() multiple times will have no effect.

Returns

Timeout

a reference to timeout

Since

v0.9.1

Implementation of

Timer.unref

Defined in

node_modules/@types/node/timers.d.ts:107

Typescript Libraries

Modules

Namespaces

Clone this wiki locally