An expansion of Self-adjusting setTimeout loop in javascript
Uses a self-adjusting timeout loop to trigger events, at somewhat consistent intervals, to drive animation.
Uncorrected loops shows a setTimeout with a fixed delay, the same delay as the adjusted setTimeout target.
Metronome drawn with Sketch
adapted from:
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js