I only started to learn javascript 2 days ago so I'm pretty new. I've written code which is optimal but takes 20 minutes to run. I was wondering if there's a simple way to parallel process with for loops e.g.
for (x=0; x<5; x++){ processor 1 do ...
for (x=5; x<10; x++){ processor 2 do ...
Since the OP wants to process the loop in parallel, the async.each()
function from the async library is the ideal way to go.
I've had faster execution times using async.each
compared to forEach
in nodejs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With