mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
* Fix setInterval regression * Add some comments * Add another test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
16 lines
332 B
JavaScript
Generated
16 lines
332 B
JavaScript
Generated
var lastCall = performance.now();
|
|
const delta = 16;
|
|
let tries = 100;
|
|
setInterval(() => {
|
|
const now = performance.now();
|
|
console.log((now - lastCall) | 0, "ms since the last call");
|
|
if (now - lastCall < ((delta / 2) | 0)) {
|
|
process.exit(1);
|
|
}
|
|
lastCall = now;
|
|
|
|
if (--tries === 0) {
|
|
process.exit(0);
|
|
}
|
|
}, delta);
|