mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
19 lines
343 B
TypeScript
19 lines
343 B
TypeScript
const timeBefore = performance.now();
|
|
|
|
const requests: Promise<Response>[] = [];
|
|
|
|
// Repeat 1000 times
|
|
for (let i = 0; i < 1000; i++) {
|
|
requests.push(
|
|
fetch(`https://mastodon.social`, {
|
|
method: "GET",
|
|
})
|
|
);
|
|
}
|
|
|
|
await Promise.all(requests);
|
|
|
|
const timeAfter = performance.now();
|
|
|
|
console.log(`Time taken: ${timeAfter - timeBefore}ms`);
|