From 2f766bbfa6321de5eb9a0a4ce0e7f5df23962348 Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 20 Jul 2018 22:22:30 +0200 Subject: Enforce constancy --- pointless/viewer/timer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pointless/viewer/timer.js') diff --git a/pointless/viewer/timer.js b/pointless/viewer/timer.js index 4f19986..28c3f97 100644 --- a/pointless/viewer/timer.js +++ b/pointless/viewer/timer.js @@ -18,19 +18,19 @@ class Timer { if (this.startTime != null) return; this.startTime = Date.now(); - var self = this; + const self = this; setInterval(function() { self._runTimer(); }, 1000); } _runTimer() { - var timeDelta = Math.floor((Date.now() - this.startTime) / 1000); + const timeDelta = Math.floor((Date.now() - this.startTime) / 1000); this._setDisplay(timeDelta); } _setDisplay(seconds) { - var dateObj = new Date(null); + const dateObj = new Date(null); dateObj.setSeconds(seconds); this.display.textContent = dateObj.toISOString().substr(11, 8); } -- cgit v1.2.3