aboutsummaryrefslogtreecommitdiff
path: root/bench/fetch/deno.js
blob: 1117a38df697d5db3a66c681414d85e381ae4c38 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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();