@tempots/std
sleep() function
Sleep for a given number of milliseconds.
Signature:
sleep: (ms: number, { abortSignal }?: {
abortSignal?: AbortSignal;
}) => Promise<void>
Parameters
Parameter |
Type |
Description |
---|---|---|
ms |
number |
The number of milliseconds to sleep. |
{ abortSignal } |
{ abortSignal?: AbortSignal; } |
(Optional) |
Returns: Promise
A promise that resolves after the given number of milliseconds.