venom-bot
Version:
Venom is a high-performance system developed with JavaScript to create a bot for WhatsApp, support for creating any interaction, such as customer service, media sending, sentence recognition based on artificial intelligence and all types of design archite
26 lines (22 loc) • 570 B
JavaScript
class Counter {
constructor(msTime) {
this.isFirstCall = true;
this.startTime = '';
}
counterInit() {
if (this.isFirstCall) {
console.log(`Starting count down for close`);
this.isFirstCall = false;
this.startTime = new Date();
} else return false;
}
getElapsedTime() {
//console.log('Elapsed Time ' + this.calculateTime())
return this.calculateTime();
}
calculateTime() {
let currentTime = new Date();
return Math.round(currentTime.getTime() - this.startTime.getTime());
}
}
module.exports = Counter;