aboutsummaryrefslogtreecommitdiff
path: root/pointless/viewer/timer.js
diff options
context:
space:
mode:
Diffstat (limited to 'pointless/viewer/timer.js')
-rw-r--r--pointless/viewer/timer.js6
1 files changed, 3 insertions, 3 deletions
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 {
18 if (this.startTime != null) return; 18 if (this.startTime != null) return;
19 this.startTime = Date.now(); 19 this.startTime = Date.now();
20 20
21 var self = this; 21 const self = this;
22 setInterval(function() { 22 setInterval(function() {
23 self._runTimer(); 23 self._runTimer();
24 }, 1000); 24 }, 1000);
25 } 25 }
26 26
27 _runTimer() { 27 _runTimer() {
28 var timeDelta = Math.floor((Date.now() - this.startTime) / 1000); 28 const timeDelta = Math.floor((Date.now() - this.startTime) / 1000);
29 this._setDisplay(timeDelta); 29 this._setDisplay(timeDelta);
30 } 30 }
31 31
32 _setDisplay(seconds) { 32 _setDisplay(seconds) {
33 var dateObj = new Date(null); 33 const dateObj = new Date(null);
34 dateObj.setSeconds(seconds); 34 dateObj.setSeconds(seconds);
35 this.display.textContent = dateObj.toISOString().substr(11, 8); 35 this.display.textContent = dateObj.toISOString().substr(11, 8);
36 } 36 }