ravendb
Version:
RavenDB client for Node.js
29 lines • 700 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Stopwatch = void 0;
class Stopwatch {
_startDate;
_endDate;
start() {
this._startDate = new Date();
}
stop() {
this._endDate = new Date();
}
get elapsed() {
if (!this._startDate) {
return 0;
}
if (!this._endDate) {
return Date.now() - this._startDate.valueOf();
}
return this._endDate.valueOf() - this._startDate.valueOf();
}
static createStarted() {
const s = new Stopwatch();
s.start();
return s;
}
}
exports.Stopwatch = Stopwatch;
//# sourceMappingURL=Stopwatch.js.map