From 20004526da3ddd82e0f81b974c4ae0d96c246ac9 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 17 Jul 2022 02:30:26 +0200 Subject: [PATCH] Create async sleep utility function --- utils/asleep.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 utils/asleep.ts diff --git a/utils/asleep.ts b/utils/asleep.ts new file mode 100644 index 0000000..8b159de --- /dev/null +++ b/utils/asleep.ts @@ -0,0 +1,3 @@ +export async function asleep(ms: number) { + return await new Promise(r => setTimeout(r, ms)); +} \ No newline at end of file