0.0.6 • Published 10 years ago
ybm v0.0.6
ybm
Your benchmark.
CLI
Install
npm install --global ybmUsage
Watch
ybm --watch some-benchmark-fileWhen
some-benchmark-fileupdated, will trigger re-benchmark this file.
Cycle
ybm --cycle 3 some-benchmark-fileRun
some-benchmark-filethree times.NVM - switch node version to run your benchmark file
ybm --nvm "iojs-v1.0.4, iojs-v2.0.0" some-benchmark-fileRun
some-benchmark-fileoniojs-v1.0.4andiojs-v2.0.0
Using ybm -h to see more help.
NODE
Install
npm install --save ybmUsage
Single test:
ybm(function() { // do task });Async test:
ybm(function(done) { setTimeout(done, 100); });Suite tests:
ybm.suite({ 'test_1': function() { /* do task */ }, 'test_2': function() { /* do task */ }, 'test_3': function() { /* do task */ } });Cycle suite tests:
ybm.cycle(5, { 'test_1': function() { /* do task */ }, 'test_2': function() { /* do task */ }, 'test_3': function() { /* do task */ } });Matrix suite tests:
var matrix = [ row1, row2, //... ]; ybm.matrix(matrix, function(row) { // create suite according row return suite; })
More Examples:
TODO
- Add
ybm.cycle- 2015/06/23 - Support
nvmto switch node test - 2015/06/24
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.
Thanks
- benchmark - A benchmarking library that works on nearly all JavaScript platforms, supports high-resolution timers, and returns statistically significant results.
History
License
Copyright (c) 2015 Zhonglei Qiu. Licensed under the MIT license.