scratch-vm/src/util/timer.js

21 lines
316 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.stop = function () {
return this.startTime - this.time();
};
module.exports = Timer;