Skip to main content

Timeout

Class

A handle for a timer.

A handle for a timer. You can create a timeout using setTimeout.

Index

Example

const timer = setTimeout(() => {
console.log('Deferred work executed after 1 second');
}, 1000);
console.log(`Timer scheduled: ${timer}`);
const cancelled = setTimeout(() => {
console.log('This will not run');
}, 5000);
clearTimeout(cancelled);

Extends

Methods

getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame