{
let timings = [];
for (let batchSize of [100, 1000, 5000]) {
let start = performance.now();
for (let i = 0; i < 10000; i += batchSize) {
let numbers = [];
for (let j = i; j < i + batchSize; j++) numbers.push(j * 2);
yield numbers;
}
timings.push(
`| ${batchSize} | ${(performance.now() - start).toFixed(2)} |`
);
}
yield md`| batch size | milliseconds |
| --- | --- | --- |
${timings.join("\n")}`;
}