Okay, further discussion time.
I've created a little bit of a performance test on this
. The output format is "<min of all runs>, <last five runs>, <max of all runs>". The timing is setup so that I'm measuring as close to the "outside of my code" time as possible. So my timing code is essentially
set current_time to NOW()
calculate difference from last time
set last_time to NOW()
so the time covered between last_time and current_time is pretty much all setTimeout or setInterval's time.
When I run this in Google Chrome 6 beta, I get numbers like "1, 5,5,5,5,5, 6" for both setTimeout and setInterval.
Internet Explorer 8: "15, 15,15,16,16,16, 16", again on both setTimeout and setInterval.
Android Browser on the Motorola Droid: "0, 1,9,10,13,13, 40". Both loops are similar again, though there is a very noticeable lack of stability in the numbers, whereas Chrome and IE had settled into an fairly unvarying stream of numbers.
Anyway, the upshot of this is that HTML5 cannot yet be used for even 30FPS animation on Android Browser yet, as it frequently dips above the 33ms threshold, just to return to the next frame update
, say nothing about how much processing can be done during that update.
(NOTE: The comparable order of magnitude between the IE and Android numbers is something I've noticed before. Yes, IE8 on a 2.33GHz Core 2 Duo machine often feels similar to Android Browser on a 550MHz Arm Cortex. These numbers aren't the total story, but I've experienced other situations where this has come up. Shameful, shameful, shameful)