node/deps/npm/node_modules/minimatch/benchmark.js
Forrest L Norvell e79ccee168 npm: upgrade to v2.1.18
PR-URL: https://github.com/iojs/io.js/pull/266
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 23:49:03 +01:00

16 lines
425 B
JavaScript

var m = require('./minimatch.js')
var pattern = "**/*.js"
var expand = require('brace-expansion')
var files = expand('x/y/z/{1..1000}.js')
var start = process.hrtime()
for (var i = 0; i < 1000; i++) {
for (var f = 0; f < files.length; f++) {
var res = m(pattern, files[f])
}
if (!(i%10)) process.stdout.write('.')
}
console.log('done')
var dur = process.hrtime(start)
console.log('%s ms', dur[0]*1e3 + dur[1]/1e6)