Closed robross0606 closed 2 months ago
start()
is also called every time interval()
is called, which means you're creating an interval, probably killing it, and creating a new one just because one is created when the module is imported.
Also, why is interval capped at 16ms?
Also, why is interval capped at 16ms?
I'm pretty sure this project is dead and incredibly out of date. Don't use it.
@rickfero, thank you for the candid advice. I was attracted to the smoothing algorithms in this project. Short of using perf_hooks
which has its own issues, do you know of a good replacement?
No sorry, I don't think there are any working libraries now. The various too-busy libraries from 10 years ago never worked well including this one.
What about ones not based on too-busy at all? Something completely different?
Sorry, I don't know. ask https://www.reddit.com/r/node/
Okay, thanks for the info.
I'd ask what your needs are. Interval is not allowed to be less than 16ms because (at the time) it was generally not possible to get reliable results that quickly.
I agree that start() should not be invoked at import. Changing it would be breaking, of course. But you could work around this by immediately calling shutdown(), then interval().
It is a bit of a code smell to invoke
state()
the second someone imports the module. It makes the library lest testable and controllable. Allow users to import the module and then callstart()
andshutdown()
as they desire.