4 exports.Timer = Timer = (function() {
9 this._handler = (function(_this) {
11 _this.running = false;
18 Timer.prototype.start = function(timeout) {
20 clearTimeout(this.id);
22 this.id = setTimeout(this._handler, timeout);
23 return this.running = true;
26 Timer.prototype.stop = function() {
28 clearTimeout(this.id);
30 return this.id = null;
38 Timer.start = function(timeout, func) {
39 return setTimeout(func, timeout);