Created
December 12, 2021 08:19
-
-
Save exhesham/79322745fde2fcea5a589deaa9954ba9 to your computer and use it in GitHub Desktop.
sol1.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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