用setTimeout代替setInterval

递归调用

let time = null;
const handleTimeout = () => {
    time = setTimeout(() => {
       clearTimeout(time);
      handleTimeout();
    })
}

你可能感兴趣的:(用setTimeout代替setInterval)