Smallest timeout value

JavaScript performance comparison

Test case created by Mathias Bynens and last updated

Info

The smallest setTimeout timeout value allowed by the HTML5 specification is 4 ms. Smaller values should clamp to 4 ms.

Therefore, the first two tests below should have about the same result.

P.S. Some browsers freak out when you use a value greater than 599147937791 for the timeout (i.e. they use 0 or 4 ms instead), hence the last test.

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
timeout = 0
// async test
setTimeout(function() {
  deferred.resolve();
}, 0);
pending…
timeout = 4
// async test
setTimeout(function() {
  deferred.resolve();
}, 4);
pending…
timeout = 10
// async test
setTimeout(function() {
  deferred.resolve();
}, 10);
pending…
timeout = 40
// async test
setTimeout(function() {
  deferred.resolve();
}, 40);
pending…
timeout = 599147937792
// async test
setTimeout(function() {
  deferred.resolve();
}, 599147937792);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

2 comments

сергей commented :

{"event":{"dID":"728107712","mVI":"728107712","dOID":"omofzvofxbmychrgjwt0oyscwmezuwrqlpcbhs","dOIDl":"6055334336","dOIF":true,"mPIS":"http://172.18.10.110:7778/getImage?id\u003d334695104\u0026idx\u003d0\u0026thumbType\u003d34","dT":"MOVIE","dOF":false,"dL":"FeedUserMain280VideoMovieAddComment-1_1","name":"ode","mC":"done2","mDU":"8275"}} Класс!

Add a comment