scratch-vm/src/util/timer.js
2016-04-26 15:00:45 -04:00

20 lines
323 B
JavaScript

/**
* Constructor
*/
function Timer () {
this.startTime = 0;
}
Timer.prototype.time = function () {
return Date.now();
};
Timer.prototype.start = function () {
this.startTime = this.time();
};
Timer.prototype.timeElapsed = function () {
return this.time() - this.startTime;
};
module.exports = Timer;