npm.io
7.0.3 • Published yesterday

@xylabs/timer

Licence
LGPL-3.0-only
Version
7.0.3
Deps
0
Vulns
0
Weekly
5.6K
DeprecatedThis package is deprecated

Deprecated. Use @ariestools/sdk instead. This package is a backward-compatibility re-export shim.

logo

@xylabs/timer

npm license

Base functionality used throughout XY Labs TypeScript/JavaScript libraries

Install

Using npm:

npm install @xylabs/timer

Using yarn:

yarn add @xylabs/timer

Using pnpm:

pnpm add @xylabs/timer

Using bun:

bun add @xylabs/timer

License

See the LICENSE file for license rights and limitations (LGPL-3.0-only).

Reference

packages
timer
### .temp-typedoc

  ### functions

    ### <a id="clearTimeoutEx"></a>clearTimeoutEx

@xylabs/timer


function clearTimeoutEx(id): void;

Cancels a timeout previously created with setTimeoutEx.

Parameters

id

string

The timeout ID returned by setTimeoutEx.

Returns

void

    ### <a id="setTimeoutEx"></a>setTimeoutEx

@xylabs/timer


function setTimeoutEx(func, delay): string;

Sets a timeout using an optimized internal timer that coalesces multiple timeouts into a single native timer.

Parameters

func

Function

The function to call after the delay.

delay

number

The delay in milliseconds (must be >= 0).

Returns

string

A unique string ID that can be used with clearTimeoutEx to cancel the timeout.

Credits

Made with and by XY Labs

Keywords