summaryrefslogtreecommitdiff
path: root/public/timer_worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/timer_worker.js')
-rw-r--r--public/timer_worker.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/public/timer_worker.js b/public/timer_worker.js
index 3d3e79a..c62679a 100644
--- a/public/timer_worker.js
+++ b/public/timer_worker.js
@@ -1,10 +1,11 @@
let timerInterval = null;
+let timerTimeout = 10;
function setTimerInterval() {
if (!timerInterval) {
timerInterval = setInterval(function() {
postMessage("timerTick");
- }, 10);
+ }, timerTimeout);
}
}
@@ -20,5 +21,7 @@ onmessage = function(event) {
} else {
clearTimerInterval();
}
+ } else if ("set_timeout" in event.data) {
+ timerTimeout = event.data["set_timeout"];
}
}