mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
19 lines
350 B
JavaScript
19 lines
350 B
JavaScript
'use strict';
|
|
|
|
class Timer {
|
|
constructor(startImmediately) {
|
|
this.startTime = startImmediately ? new Date().getTime() : null;
|
|
this.endTime = null;
|
|
}
|
|
|
|
start() {
|
|
this.startTime = new Date().getTime();
|
|
}
|
|
|
|
stop() {
|
|
this.endTime = new Date().getTime();
|
|
return (this.endTime - this.startTime);
|
|
}
|
|
}
|
|
|
|
module.exports = Timer; |