const suite = new Benchmark.Suite()
+/**
+ *
+ */
function promise () {
return new Promise()
}
+/**
+ *
+ */
async function asyncFunction () {
await promise()
}
suite
- .add('await promise', async function () {
+ .add('await promise', async () => {
await asyncFunction()
})
- .add('promise', function () {
+ .add('promise', () => {
asyncFunction()
})
- .on('cycle', function (event) {
+ .on('cycle', event => {
console.log(event.target.toString())
})
.on('complete', function () {
console.log(
'Fastest is ' + LIST_FORMATTER.format(this.filter('fastest').map('name'))
)
- // eslint-disable-next-line no-process-exit
+ // eslint-disable-next-line n/no-process-exit
process.exit()
})
.run()