diff options
Diffstat (limited to 'bench/snippets/async-overhead.mjs')
-rw-r--r-- | bench/snippets/async-overhead.mjs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/bench/snippets/async-overhead.mjs b/bench/snippets/async-overhead.mjs index bec278b56..753af1632 100644 --- a/bench/snippets/async-overhead.mjs +++ b/bench/snippets/async-overhead.mjs @@ -19,13 +19,10 @@ bench("promise.nextTick", async function () { }); bench("await new Promise(resolve => resolve())", async function () { - await new Promise((resolve) => resolve()); + await new Promise(resolve => resolve()); +}); +bench("Promise.all(Array.from({length: 100}, () => new Promise((resolve) => resolve())))", async function () { + return Promise.all(Array.from({ length: 100 }, () => Promise.resolve(1))); }); -bench( - "Promise.all(Array.from({length: 100}, () => new Promise((resolve) => resolve())))", - async function () { - return Promise.all(Array.from({ length: 100 }, () => Promise.resolve(1))); - }, -); await run(); |