this.startTime = Date.now();
getLoginTimer() {
if(!this.isPause) {
this.timer = setInterval(() => {
this.endTime = Date.now();
this.loginTimer = Math.floor((this.endTime - this.startTime)/1000);
},1000);
} else {
clearInterval(this.timer);
}
this.isPause = !this.isPause;
},
网友评论