Hacker News new | ask | show | jobs
by deadhead 3796 days ago
It happens to me as well (Windows, Chrome) but inconsistently (sometimes, its on time). Looking at the JS, it might be since it schedules to check for updates every 100ms (`timerId = setInterval(update, 100);`) instead of scheduling a callback for the time of the next bar.

Edit: Also, the JS `setInterval` callback can be delayed.

Edit: After debugging their code some more, the above isn't why (though is still inefficient). The audio player (SoundManager) they are using only updates the audio playback time at a rough granularity. If I log the time values, I get the following (all in milliseconds):

    0
    182.404
    681.59
    1180.778
    1680.963
    2179.152
    ...
The song is 120 BPM which means that the first bar changes is at 2000ms causing the first bar change to be 179ms late.