Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

109
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda