-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseTimer.js
More file actions
30 lines (30 loc) · 909 Bytes
/
BaseTimer.js
File metadata and controls
30 lines (30 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright © Sam Savage 2016
/// <reference path="Scripts/typings/jquery/jquery.d.ts" />
var BaseTimer = (function () {
function BaseTimer(elementId) {
this.timeId = elementId;
this.timerTimeout = 10;
this.updateTime();
return;
}
BaseTimer.prototype.updateTime = function () {
$("#" + this.timeId).text(new Date().toUTCString());
return;
};
BaseTimer.prototype.start = function () {
var _this = this;
this.timerToken = setInterval(function () { return _this.onTimerElapse(); }, this.timerTimeout);
return;
};
BaseTimer.prototype.stop = function () {
clearInterval(this.timerToken);
return;
};
BaseTimer.prototype.onTimerElapse = function () {
this.updateTime();
this.dostuff();
return;
};
return BaseTimer;
})();
//# sourceMappingURL=BaseTimer.js.map