Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

108
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda