-
-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathutil.js
More file actions
19 lines (18 loc) · 539 Bytes
/
util.js
File metadata and controls
19 lines (18 loc) · 539 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var benchmark = require('benchmark')
exports.suite = function (isAsync) {
var suite = new benchmark.Suite()
process.nextTick(function () {
suite
.on('error', function (event) {
console.error(event.target.error.stack)
})
.on('cycle', function (event) {
console.log(String(event.target))
})
.on('complete', function () {
console.log('Fastest is ' + this.filter('fastest').map('name'))
})
.run({ async: isAsync === undefined ? true : isAsync })
})
return suite
}