0.1.1 • Published 8 years ago

first-step-benchmark v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

first-step-benchmark

A scaffolding tool to benchmark.js

Install

npm install -g first-step-benchmark

Usage

first-step-benchmark test.js

And you will get a new file like below:

// test.js

var benchmark = require('benchmark');

var suite = new Benchmark.Suite;

// add your first test
suite.add('${TEST NAME}', function() {
  // Your Test codes goes here
})
// add more tests
//.add('ONE MORE TEST', function() {})

// add listeners
suite.on('cycle', function(event) {
  console.log(String(event.target));
})
.on('complete', function() {
  console.log('Fastest is ' + this.filter('fastest').map('name'));
})
.run({ 'async': true });