We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21f7525 commit 4282c4bCopy full SHA for 4282c4b
packages/common/src/util/sleep.ts
@@ -1,5 +1,3 @@
1
-import { promisify } from "util";
2
-
3
/**
4
* Sleep function that returns a promise that resolves when the sleep is
5
* complete.
@@ -8,6 +6,6 @@ import { promisify } from "util";
8
6
* on failure, and this function will sleep the same amount of time every time
9
7
* the test is retried. Prefer {@link sleepWithBackoff} instead.
10
*/
11
-const sleep = promisify(setTimeout);
12
13
-export default sleep;
+export default function sleep(ms: number): Promise<void> {
+ return new Promise((resolve) => setTimeout(resolve, ms));
+}
0 commit comments