UNPKG

ravendb

Version:
25 lines 571 B
export 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; } } //# sourceMappingURL=Stopwatch.js.map