Smallest timeout value (v6)

Revision 6 of this benchmark created on


Description

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

Ready to run.

Testing in
TestOps/sec
timeout = 0
// async test
setTimeout(function() {
  deferred.resolve();
}, 0);
ready
timeout = 4
// async test
setTimeout(function() {
  deferred.resolve();
}, 4);
ready
timeout = 10
// async test
setTimeout(function() {
  deferred.resolve();
}, 10);
ready
timeout = 40
// async test
setTimeout(function() {
  deferred.resolve();
}, 40);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.