aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/js/bun/util/sleepSync.test.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/js/bun/util/sleepSync.test.ts b/test/js/bun/util/sleepSync.test.ts
index e4204e1d3..21052d314 100644
--- a/test/js/bun/util/sleepSync.test.ts
+++ b/test/js/bun/util/sleepSync.test.ts
@@ -2,11 +2,11 @@ import { it, expect } from "bun:test";
import { sleepSync } from "bun";
it("sleepSync uses milliseconds", async () => {
- const start = Date.now();
- sleepSync(5);
- const end = Date.now();
+ const start = performance.now();
+ sleepSync(50);
+ const end = performance.now();
expect(end - start).toBeGreaterThanOrEqual(5);
- expect(end - start).toBeLessThan(10);
+ expect(end - start).toBeLessThan(1000);
});
it("sleepSync with no arguments throws", async () => {