Setup and teardown run many times

Benchmark created by Chris Antaki on


Preparation HTML

<script src="http://underscorejs.org/underscore-min.js"></script>

<script>
var setup = 0,
    teardown = 0;

var log = _.debounce(function() {
    console.log('setups:', setup);
    console.log('teardowns:', teardown);
}, 1000);

</script>

Setup

setup++;

Teardown


    teardown++;
  

Test runner

Ready to run.

Testing in
TestOps/sec
Logging setups & teardowns
log();
ready
Logging setups & teardowns again
log();
ready

Revisions

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

  • Revision 1: published by Chris Antaki on