Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
Call function 30 times simultaneously without any different milliseconds timing in NodeJS?

I want to call function 30 times simultaneously, without any different milliseconds timing, let say there are function name:

orderFlashsaleProduct();

If i call orderFlashsaleProduct(); function 30 times, generally we can use looping method like this:

for(var a = 0; a < 30; a++) {
    orderFlashsaleProduct();
}

But "looping method" called function in "sequential way" not "simultaneously". So if we pay attention about timing in milliseconds, there are different timing between call function process.

If we create looping console.log milliseconds of current time it will look like this:

for(var a = 0; a < 30; a++) {
    console.log(new Date().getMilliseconds());
}

And printed console.log milliseconds value will look like this:

418
418
418
419
419
419
419
420
420
420
420
420
...

As we can see, there are different milliseconds timing when looping start and when looping the end. I need more speed timing when called function 30 times.

At least, when we called function 30 times, i want that execute simultaneously in same milliseconds. Let say, when we start called function 30 times at milliseconds 418, then all called at milliseconds 418. No different timing.

I'm not talking about hundreds or thousands times called function in simulataneosly. I know, that's impossible. Just 30 or 20 or 10 times but in the perfect timing so it will be the real "simultaneously".

Is there any way?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!