Skip to content

Instantly share code, notes, and snippets.

@exhesham
Created December 12, 2021 08:19
Embed
What would you like to do?
sol1.ts
async function solution1() {
for(let i = 0; i < tasksSleepInput.length; i+= chunkSize) {
let batch = tasksSleepInput.slice(i, i + chunkSize);
console.log(`* start running batch ${i}`);
await Promise.all(batch.map(taskExecutor));
console.log(`* finished running batch ${i}`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment