scratch-vm/src/util/timer.js

21 lines
323 B
JavaScript
Raw Normal View History

2016-04-18 17:20:30 -04:00
/**
* 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;
2016-04-18 17:20:30 -04:00
};
module.exports = Timer;