I would like to put
var minValue = 0;
if ( typeof callback == \'function\' ) {
setTimeout( callback, minValue );
}
this code when I imp
This article tests Firefox, Safari, and Opera and plots performance graphs:
http://ejohn.org/blog/analyzing-timer-performance/
Firefox 2, Opera, and Safari all have a bottom window of 10ms for delays
For older browsers, you can do a test like the one in that article. I just ran a test that I had from a while ago of setInterval using a 10ms interval in IE6, and I got an average of 55ms. setTimeout seems to be lower at 35ms.
I ran the test in Chromium and got ~11ms average for a 10ms timeout. I tried it with 4ms and 1ms intervals and got ~4.5ms for both. Also, keep in mind that the numbers could vary among operating systems.
If you're interested, here's the test code: