Smallest timeout value (v39)

Revision 39 of this benchmark created by Abhisek Pattnaik 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 src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="myName">Navnath</div>

Test runner

Ready to run.

Testing in
TestOps/sec
timeout = 0
// async test
$(document).ready(function() {

  var a = document.getElementById('myName');

  alert(a);

});
ready
timeout = 4
// async test
$(document).ready(function() {

  var a = $('#myName').html();

  alert(a);

});
ready

Revisions

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