While condition 2

JavaScript performance comparison

Test case created by Natee Iavarone and last updated

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var x = 2;
    var y = 2;
};

Benchmark.prototype.teardown = function() {
    x = 2;
    y = 2;
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
On Truthy
while ( x ) {
    x--;
}
pending…
Not Zero
while ( x !== 0 ) {
    x--;
}
pending…

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

Compare results of other browsers

0 comments

Add a comment