Last active
January 1, 2016 12:09
-
-
Save floatdrop/8142601 to your computer and use it in GitHub Desktop.
Benchmark yeoman-generator require time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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