3 ms·
I don't know the answer to this, but I've always been genuinely curious: how accurate is the Date object? setInterval's minimum interval is ~15ms [1], so shoul
by menssen 7y ago
I don't know the answer to this, but I've always been genuinely curious: how accurate is the Date object?
setInterval's minimum interval is ~15ms [1], so shouldn't something like...
setInterval(() => (new Date()).valueOf() % DESIRED_TICK_INTERVAL < 15 && tickTheMetronome(), 15)
...get you within 15ms accuracy, and it can probably be reduced in Chrome et al?
[1] http://www.adequatelygood.com/Minimum-Timer-Intervals-in-JavaScript.html http://www.adequatelygood.com/Minimum-Timer-Intervals-in-Jav...
- jcelerier 7y agoand to say that 20 years ago people were laughing at MS windows and considering it as a completely non-viable platform for pro audio for its 10ms-accurate timer...