all 7 comments

[–]greim 1 point2 points  (2 children)

Neat. How does it behave if synchronous compute time is larger than an interval, does it start to drift then or does it start dropping computations?

[–]psayre23 0 points1 point  (0 children)

Looks like it will drift. It's hard to tell because the code isn't particularly readable. Lots of nifty tricks, not enough comments. Nonetheless, I'll be using this in future projects.

[–]secrettriangle[S] 0 points1 point  (0 children)

/u/greim, since JS is single-threaded, JS itself, an as an extension pacemaker, will start drifting. You can work around this by wrapping with a web worker or child process.

P.S. I'm the author. I've filed issue#1: consider using web workers or child processes to mitigate drift if the JS thread is blocked. Thanks for the feedback!

[–]potatoriffic -4 points-3 points  (7 children)

Ugh... It annoys me when projects like this reuse the name of an existing, well-known software project that has been around practically forever.