Answer the question
In order to leave comments, you need to log in
What is the correct way to do setInterval in Node?
It is necessary to give a number to clients every 2 seconds. Is it right to do so?
setInterval(() => {
const bitcoin_price = Math.random() * (6000 - 0) + 0;
clients.forEach(resolve => {
resolve(bitcoin_price);
});
clients = [];
}, 2000);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question