Skip to content

Instantly share code, notes, and snippets.

@floatdrop
Last active January 1, 2016 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floatdrop/8142601 to your computer and use it in GitHub Desktop.
Save floatdrop/8142601 to your computer and use it in GitHub Desktop.
Benchmark yeoman-generator require time
// npm i -g mathca yeoman-generator
// matcha test.js
var spawn = require('child_process').spawn;
suite('yeoman-generator', function () {
set('iterations', 1000);
set('type', 'static');
set('mintime', 5000);
set('delay', 0);
bench('require', function(next) {
var r = spawn('node', ['-e', '"require(\'yeoman-generator\');"']);
r.on('close', function() {
next();
});
});
bench('console.log', function(next) {
var r = spawn('node', ['-e', '"console.log(\'done\')"']);
r.on('close', function() {
next();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment