From 09d72ce3a79685ea88542dd7dd4eac3b14e3058f Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Thu, 12 May 2022 17:34:33 +0200 Subject: [PATCH] Fix: Wrong time used for calculation --- src/static/js/synced-timer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/synced-timer.js b/src/static/js/synced-timer.js index 328a293..f27878f 100644 --- a/src/static/js/synced-timer.js +++ b/src/static/js/synced-timer.js @@ -29,7 +29,7 @@ document.addEventListener('alpine:init' , () => { setInterval(() => { if(!this.currentData) return; - const passedSeconds = parseInt(((Date.now()-this.timeOffsetToServer) / 1000) - this.currentData.startedAt); + const passedSeconds = parseInt(((performance.now()-this.timeOffsetToServer) / 1000) - this.currentData.startedAt); let remaningSeconds; if(this.currentData.repeatEnabled) { remaningSeconds = parseInt(this.currentData.time * 60 - (passedSeconds % (this.currentData.time * 60)));