Answer the question
In order to leave comments, you need to log in
Node.js how to make an event execute at a specific time?
Let's say there is an event that should be executed in n-th number of seconds on the server. How is this implemented in Node.js? Only through setInterval or maybe there are some other options?
Answer the question
In order to leave comments, you need to log in
well, setInterval and setTimeout,
why is it bad? It starts in a separate thread and spins there - well)
in fact, how else to measure the exact number of seconds?
You can, of course, respond to a request to the server. But then you need to ensure a uniform distribution of requests (setInterval =) )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question