Smallest timeout value
JavaScript performance comparison
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.
| Test | Ops/sec | |
|---|---|---|
timeout = 0 |
|
pending… |
timeout = 4 |
|
pending… |
timeout = 10 |
|
pending… |
timeout = 40 |
|
pending… |
timeout = 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:
- Revision 1: published by Mathias Bynens and last updated
- Revision 2: published by Thomas Aylott
- Revision 3: published
- Revision 6: published
- Revision 7: published
- Revision 8: published
1 comment
Here’s the test case Mozilla used: https://bug257454.bugzilla.mozilla.org/attachment.cgi?id=157438