R
R
Rostislav Ignatenko2017-07-17 18:27:30
Node.js
Rostislav Ignatenko, 2017-07-17 18:27:30

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

2 answer(s)
D
Dmitry Eremin, 2017-07-17
@EreminD

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 =) )

E
emp1re, 2017-07-18
@emp1re

If the question is about performing actions on a schedule, then - schedule
If about the delay in seconds, Dmitry correctly suggested everything to you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question