SysBackup/timer.js

14 lines
286 B
JavaScript
Raw Normal View History

2022-08-08 12:39:35 +00:00
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;