declare function in loop

Benchmark created on


Setup

var i = 0;

Teardown


    i = 0;
  

Test runner

Ready to run.

Testing in
TestOps/sec
outside loop
var test = function(n) {
  i += n;
}
for (l = 100000; l >= 0; --l) {
  test(l);
}
ready
inside loop
for (l = 100000; l >= 0; --l) {
  (function(n) {
    i += n;
  })(l);
}
ready

Revisions

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