real interval是一款JS解决当电脑或者APP休眠了一段时间后,倒计时会出现问题的插件,当休眠的电脑被唤醒后,插件会计算出正确的运行时间,你的回调函数可以据此显示正确的剩余时间,或者判断何时应该停止倒计时。
var timer = new Interval(function(pass){
console.log(pass);
// stop after 24 hours
if(pass == 60*60*24){
this.stop();
};
}, 1000);
Gitee 地址 :https://gitee.com/mirrors/real-interval