This commit is contained in:
Manav Rathi 2024-04-15 15:57:57 +05:30
parent 4c88f5eec9
commit 8cdb31783b
No known key found for this signature in database

View file

@ -1,7 +1,11 @@
export async function sleep(time: number) {
await new Promise((resolve) => {
setTimeout(() => resolve(null), time);
});
/**
* Wait for {@link ms} milliseconds
*
* This function is a promisified `setTimeout`. It returns a promise that
* resolves after {@link ms} milliseconds.
*/
export async function sleep(ms: number) {
await new Promise((resolve) => setTimeout(resolve, ms));
}
export function downloadAsFile(filename: string, content: string) {