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.