fling
Version:
JSON Fling is a simple JSON-RPC framework for NodeJS with built-in permissions and support for different transports.
19 lines (14 loc) • 321 B
JavaScript
;
var Timer = function () {
this._date = null;
};
Timer.prototype.start = function () {
this._date = new Date();
return this;
};
Timer.prototype.stop = function () {
var startDate = this._date;
this._date = null;
return (new Date().getTime() - startDate.getTime());
};
module.exports = Timer;