aboutsummaryrefslogtreecommitdiff
path: root/bench/fetch/deno.js
blob: 929a478a0a42a6266e041595147ff9ad6379c84c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { bench, run } from "https://esm.run/mitata";

const count = 100;

bench(`fetch(https://example.com) x ${count}`, async () => {
  const requests = new Array(count);

  for (let i = 0; i < requests.length; i++) {
    requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
      r.text()
    );
  }

  await Promise.all(requests);
});

await run();