mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
11 lines
233 B
JavaScript
11 lines
233 B
JavaScript
const interval = 0.01;
|
|
const now = performance.now();
|
|
console.time("Slept");
|
|
Bun.sleepSync(interval);
|
|
const elapsed = performance.now() - now;
|
|
if (elapsed < interval) {
|
|
throw new Error("Didn't sleep");
|
|
}
|
|
|
|
console.timeEnd("Slept");
|