D
D
Dmitry Burnashev2020-11-12 09:21:54
Node.js
Dmitry Burnashev, 2020-11-12 09:21:54

How to run a function exactly every n ms in NodeJS?

Hello! Started writing a Web application to get the weight from a weight platform that a car is passing over. You need to do this in real time, because. further processing and plotting is planned.
Backend - NodeJS + Express.

How can I run a function to read the weight every n ms, exactly, without the 200-1500 ms spread that setInterval() and setTimeout() give? Or is it worth writing this part of the program in another language (which one would you recommend)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
acwartz, 2020-11-12
@dilepremon

On C / C ++ for a microcontroller with RTOS on board. This is if you really understand why you need a second in a second:

How do I run a function to read the weight every n ms, exactly, without the 200-1500 ms spread that gives

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question