@xylabs/timer
v5.0.95
Published
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Readme
@xylabs/timer
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Reference
@xylabs/timer
Functions
| Function | Description | | ------ | ------ | | setTimeoutEx | Sets a timeout using an optimized internal timer that coalesces multiple timeouts into a single native timer. | | clearTimeoutEx | Cancels a timeout previously created with setTimeoutEx. |
functions
clearTimeoutEx
function clearTimeoutEx(id: string): void;Cancels a timeout previously created with setTimeoutEx.
Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| id | string | The timeout ID returned by setTimeoutEx. |
Returns
void
setTimeoutEx
function setTimeoutEx(func: Function, delay: number): string;Sets a timeout using an optimized internal timer that coalesces multiple timeouts into a single native timer.
Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| 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.
Part of sdk-js
Maintainers
License
See the LICENSE file for license details
