Smallest timeout value (v50)

Revision 50 of this benchmark created by Jared 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() {
  console.log('yo');
}, 0);
ready
timeout = 4
// async test
setTimeout(function() {
  console.log('yo');
}, 4);
ready
timeout = 10
// async test
setTimeout(function() {
  console.log('yo');
}, 10);
ready
timeout = 40
// async test
setTimeout(function() {
  console.log('yo');
}, 40);
ready
timeout = 599147937792
// async test
setTimeout(function() {
  console.log('yo');
}, 599147937792);
ready

Revisions

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