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

10 lines
268 B
TypeScript
Raw Normal View History

2023-07-15 19:19:41 +00:00
/**
* 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);
});
}