diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-24 12:22:53 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-24 12:22:53 +0200 |
commit | 34272321256075e681181191c24e8757184c6835 (patch) | |
tree | 08bbaa9bc6c65f64d7273abbf125263575c6a38d /web/js | |
parent | 78684bd2f31a6e8bd174219d363d116e1273f6a2 (diff) |
front: Track frontend run-time
Mainly for future use. To avoid notifications if we just loaded up
recently, for example.
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/nms.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/web/js/nms.js b/web/js/nms.js index afcf8dd..c617c77 100644 --- a/web/js/nms.js +++ b/web/js/nms.js @@ -38,6 +38,10 @@ var nms = { }, menuShowing:true, + _startTime:0, + get uptime() { + return (Date.now() - this._startTime)/1000; + }, _vertical: 0, get vertical() { return this._vertical }, set vertical(v) { @@ -525,6 +529,7 @@ function getInitialConfig() { */ function initNMS() { nms.timers.playback = new nmsTimer(nms.playback.tick, 1000, "Playback ticker", "Handler used to advance time"); + nms._startTime = Date.now(); // Public nmsData.registerSource("config","/api/public/config"); |