10 lines
268 B
TypeScript
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);
|
||
|
});
|
||
|
}
|