NetStorm84 / Metronome

A Visual Metronome
https://netstorm84.github.io/Metronome/
2 stars 15 forks source link

Improved accuracy of metronome #50

Closed viperet closed 4 years ago

viperet commented 4 years ago

The previous setTimeout() approach had a major flaw - timing error accumulated in 100 calls of function, leading to much longer intervals. Chnaged code to use setInterval(), that leads to much improved timing accuracy. Progress bar is animated by CSS acimations, so it's not affecting performance. Also added output of real calculated BPM and interval between ticks in ms to console.

viperet commented 4 years ago

This PR should resolve https://github.com/NetStorm84/Metronome/issues/37

NetStorm84 commented 4 years ago

Mate, that's brilliant! Thanks alot!