Smallest timeout value (v27)

Revision 27 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.

Preparation HTML

<script>
function Callback()
{
   d.resolve();
}
</script>

Setup

d = deferred;

Test runner

Ready to run.

Testing in
TestOps/sec
timeout = 0
// async test
setTimeout(Callback, 0);
ready
timeout = 4
// async test
setTimeout(Callback, 4);
ready
timeout = 10
// async test
setTimeout(Callback, 10);
ready
timeout = 40
// async test
setTimeout(Callback, 40);
ready
timeout = 599147937792
// async test
setTimeout(Callback, 599147937792);
ready

Revisions

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