template.js 416 B

12345678910111213141516171819202122
  1. 'use strict';
  2. /**
  3. * Benchmark related modules.
  4. */
  5. var benchmark = require('benchmark');
  6. /**
  7. * Preparation code.
  8. */
  9. (
  10. new benchmark.Suite()
  11. ).add('<test1>', function() {
  12. }).add('<test2>', function() {
  13. }).on('cycle', function cycle(e) {
  14. console.log(e.target.toString());
  15. }).on('complete', function completed() {
  16. console.log('Fastest is %s', this.filter('fastest').map('name'));
  17. }).run({ async: true });