先贴代码以及占坑
function startTime(duration, display) {
var timer = duration, minutes, seconds;
setInterval(() => {
hour = parseInt(timer / 60*60 % 24, 10)
minutes = parseInt(timer / 60 % 60, 10)
seconds = parseInt(timer % 60, 10);
hou
minutes = minutes < 10 ? '0' + minutes : minutes;
seconds = seconds < 10 ? '0' + seconds : seconds;
display.text(minutes + ':' + seconds);
if(--timer < 0) {
timer = duration;
}
}, 1000)
}