timeout.refresh()
- 返回: <Timeout>
timeout
的引用
将定时器的开始时间设置为当前时间,并重新调度定时器在调整为当前时间的先前指定的时长调用其回调。 这对于在不分配新的 JavaScript 对象的情况下刷新定时器很有用。
在已经调用其回调的定时器上使用它会重新激活定时器。
- Returns: <Timeout> a reference to
timeout
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.