calaldees / KaraKara

Karaoke Event System - Attendees can view and queue tracks from their mobile phones
https://karakara.uk
GNU General Public License v3.0
28 stars 9 forks source link

Align timers #129

Closed shish closed 1 year ago

shish commented 1 year ago

browser2 and player2 update state once per second, starting from when the page is loaded

If the projector is loaded at 00:00.000 and the podium is loaded at 00:00.500, then there will be a constant half-second lag as the podium only reacts to updates half a second after the projector reacts

It'd be good to have some way to say "call the update function once per second, exactly at the moment the second changes"

shish commented 1 year ago

Also setInterval() can drift...

Maybe we need a custom timer of setTimeout(round_up_to_next_second - now())