SysBackup/timer.js
2022-08-08 14:39:35 +02:00

14 lines
286 B
JavaScript

const prettytime = require('prettytime')
class Timer {
startTimer() {
this.start = Date.now();
return this;
}
endTimer() {
const ELAPSED = Date.now() - this.start;
return prettytime(ELAPSED, { decimals: 2 });
}
}
module.exports = Timer;