1
Fork 0
tildes-reextended/source/utilities/sleep.ts

10 lines
268 B
TypeScript

/**
* Promisified {@linkcode window.setTimeout}.
* @param timeout The amount of time in milliseconds to sleep for.
*/
export async function sleep(timeout: number): Promise<void> {
return new Promise((resolve) => {
window.setTimeout(resolve, timeout);
});
}