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.
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.