timeout.refresh()


将定时器的起始时间设置为当前时间,并重新安排定时器,使其在根据当前时间调整后的先前指定的时长后调用回调函数。这对于在不分配新的 JavaScript 对象的情况下刷新定时器非常有用。

【Sets the timer's start time to the current time, and reschedules the timer to call its callback at the previously specified duration adjusted to the current time. This is useful for refreshing a timer without allocating a new JavaScript object.】

在已经调用过回调的定时器上使用这个会重新激活定时器。

【Using this on a timer that has already called its callback will reactivate the timer.】