Browser | OS. "VW" means VMware Workstation 7.0.1 |
setTimeout/setInterval (backwards clock jump) |
setTimeout/setTimeout (forwards clock jump) |
IE 8.0.6001.18702 in IE8 mode | XP SP3 32-bit (VW) | Timer OK, getTime jumps | Timer OK, getTime jumps |
IE 8.0.6001.18702 in IE7 mode | XP SP3 32-bit (VW) | Timer OK, getTime jumps | Timer OK, getTime jumps |
IE 6.0.2900.5512.xpsp_sp3_gdr.090206-1234 | XP SP3 32-bit (VW) | Timer OK, getTime jumps | Timer OK, getTime jumps |
Opera 10.50 | XP SP3 32-bit (VW) | Timer OK, getTime jumps | Timer OK, getTime jumps |
Firefox 2.0.0.20 | XP SP3 32-bit (VW) | Timer OK, getTime jumps; setInterval is PROBLEMATIC(#3) | Timer OK, getTime jumps |
Firefox 3.0.7 | XP SP3 32-bit (VW) | Timer OK, getTime jumps; setInterval is PROBLEMATIC(#3) | Timer OK, getTime jumps |
Firefox 3.6 | XP SP3 32-bit (VW) | Timer OK, getTime jumps; setInterval is PROBLEMATIC(#3) | Timer OK, getTime jumps |
Chrome 4.1.249.1025 beta (40600) | XP SP3 32-bit (VW) | Timer PROBLEMATIC(#1), getTime typically moves monotonically | Timer OK, getTime jumps |
Chrome 5.0.342.2 dev | XP SP2 64-bit (VW) | Timer PROBLEMATIC(#1), getTime typically moves monotonically | Timer OK, getTime jumps |
Chrome 4.0.249.89 (38071) | Server 2008 R2 64-bit | Timer PROBLEMATIC(#1), getTime typically moves monotonically | Timer OK, getTime jumps |
Safari 4.0.4 | XP SP3 32-bit (VW) | Timer PROBLEMATIC(#2), getTime jumps | Timer OK, getTime jumps |
Safari 3.1.2 | XP SP3 32-bit (VW) | Timer PROBLEMATIC(#2), getTime jumps | Timer OK, getTime jumps |
Opera 10.10 | Ubuntu 9.10 32-bit (VW) | Timer OK, getTime jumps | Timer OK, getTime jumps |
Chrome 5.0.307.11 beta | Ubuntu 9.10 32-bit (VW) | Timer DELAYED, getTime jumps | Timer OK, getTime jumps |
Firefox 3.5.8 | Ubuntu 9.10 32-bit (VW) | Timer DELAYED, getTime jumps | Timer OK, getTime jumps |
Arora 0.10.1 | Ubuntu 9.10 32-bit (VW) | Timer DELAYED, getTime jumps | Timer OK, getTime jumps |
Midori 0.1.9 | Ubuntu 9.10 32-bit (VW) | Timer DELAYED, getTime jumps | Timer OK, getTime jumps |
Opera 10.10 | Mac OS X 10.6.2 | Timer OK, getTime jumps | Timer OK, getTime jumps |
Safari 4.0.4 | Mac OS X 10.6.2 | Timer PROBLEMATIC(#2), getTime jumps | Timer OK, getTime jumps |
Firefox 3.6 | Mac OS X 10.6.2 | Timer DELAYED, getTime jumps | Timer OK, getTime jumps |
Chrome 5.0.307.11 beta | Mac OS X 10.6.2 | Timer DELAYED, getTime jumps | Timer OK, getTime jumps |
Instructions: Adjust your system clock forwards or backwards and see what
happens. Scroll down to see if the timer is firing. If you want to, click the button to print the
time manually. Append ?setInterval
to this page URL use setInterval
instead of setTimeout. VMWare note: Since you are manually adjusting the
clock, you want to disable 'Time synchronization between the virtual machine' (click the
VMWare Tools icon in your VMWare guest).
getTime jumps means that new Date.getTime()
gives you
the system time as-is, even if it jumped back.
For backwards clock jumps, OK means that timers appear to be completely unaffected by the system time.
For fowards clock jumps, OK means that the timers still fired. (I did not test whether they fired too early.)
The DELAYED browsers appear to schedule timers exactly by the system time. If you move the clock back by N seconds, the timers will be delayed by N seconds. If you then jump the clock forwards into the timer firing zone, the browsers fire the timer. Sometimes, you'll need to click on the browser to get the timer to fire after moving the clock forward. This is probably because the browser's event loop is sleeping (this happened in Firefox 3.6 on Mac).
PROBLEMATIC(#1) Chromium/Windows is strange. If you move the clock back 2 minutes, this happens:PROBLEMATIC(#2) Safari 4.0.4/3.1.2: Safari sometimes appears to keep timers firing when the clock jumps backwards, but often they don't. I don't know why this happens. After moving it back, moving the clock forward usually doesn't help the timers to fire. Sometimes, when the clock moves back, a timer fires but the next one scheduled is delayed for a while:
[4.038s] 1268059008103 Mon, 08 Mar 2010 14:36:48 GMT [5.04s] 1268059009105 Mon, 08 Mar 2010 14:36:49 GMT [-55.581s] 1268058948484 Mon, 08 Mar 2010 14:35:48 GMT --- no activity for a while --- [7.078s] 1268059011143 Mon, 08 Mar 2010 14:36:51 GMT [8.095s] 1268059012160 Mon, 08 Mar 2010 14:36:52 GMT
Safari on Mac OS X almost looks like DELAYED, but it probably isn't. The behavior appears subtly different from Safari/Windows, too.
PROBLEMATIC(#3) Firefox/Windows: setTimeout works well, but setIntervals are not properly scheduled after the clock jumps backwards. Maybe there's some sort of numerical overflow?