Client
Server
Reference / @open-music-sdk/core / sleep
function sleep(ms, signal?): Promise<void>;Defined in: packages/core/src/retry.ts:126
Resolves after ms, or rejects with the abort reason. What it is handed is checked, since other packages call it too: a wait that is no number of milliseconds from 0, or has no end, is a TypeError, and so is a signal that is none. A wait longer than a timer keeps is kept as several, so that it is never over at once.
number
How long to wait, in milliseconds: a number from 0, and not infinity.
AbortSignal
Ends the wait early.
Promise<void>
TypeError if ms is not a number of milliseconds from 0, or is without end, or signal is given and is no AbortSignal.
The reason signal aborted with, when it does.