blob: 96e7275a855352ae6f3776124423c8e7092e3dc9 (
plain) (
blame)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 | import { bench, run } from "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();
 |