mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
* More reliable macOS event loop * Reduce CPU usage of idling * Add another implementation * Add benchmark Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
17 lines
322 B
JavaScript
17 lines
322 B
JavaScript
import { bench, run } from "../node_modules/mitata/src/cli.mjs";
|
|
|
|
bench("setTimeout(, 4) 100 times", async () => {
|
|
var i = 100;
|
|
while (--i >= 0) {
|
|
await new Promise((resolve, reject) => {
|
|
setTimeout(() => {
|
|
resolve();
|
|
}, 4);
|
|
});
|
|
}
|
|
});
|
|
|
|
setTimeout(() => {
|
|
run({}).then(() => {});
|
|
}, 1);
|