修改小数转型

This commit is contained in:
nisen
2023-11-20 15:46:50 +08:00
parent c702208b95
commit 6a811e42bc
3 changed files with 6 additions and 4 deletions

View File

@@ -480,7 +480,7 @@
let startTime = new Date().getTime();
this.appendStudyOtherHandle = setTimeout(function() {
let endTime = new Date().getTime();
let totalTime = parseInt((endTime - startTime) / 1000);
let totalTime = Math.round((endTime - startTime) / 1000);
$this.cumulativeDuration += totalTime;
if($this.cumulativeDuration <= $this.maxDuration){
//发送时长
@@ -1477,7 +1477,9 @@
//如果当前追加开始时间不为空
let now = new Date();
let m = now.getTime() - this.appendStartTime.getTime(); //相差的毫秒数
let sen = parseInt(m / 1000); //计算秒数
console.log(m/1000,'时间');
let sen = Math.round(m / 1000); //计算秒数
console.log('定时器时间',sen);
// 每次添加的是定时器计时的时间
duration = duration + sen;//追加的是秒