- From: Simon Fraser <smfr@me.com>
- Date: Wed, 03 Nov 2010 20:08:23 -0700
On Nov 3, 2010, at 8:01 PM, and-py wrote: > Here's a curious little issue. > > When you use `setTimeout` or `setInterval`, the HTML5 spec seems to say > that the callback should occur after a certain amount of actual time has > elapsed. > > But what browsers might do is take the system clock, add the given > number of milliseconds and call back when that system clock time is > reached. The firing time will differ from the actual-elapsed-time, if > the system clock is changed in between the setting and the calling of > the callback. Another issue to consider here is what happens when the machine goes to sleep, and then wakes up. This is a much more common scenario than the user changing the system clock. Simon
Received on Wednesday, 3 November 2010 20:08:23 UTC