Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.

Commit 46e961d

Browse files
dirkmchugomrdias
authored andcommitted
chore: use async-await for benchmarks (#41)
1 parent fa17918 commit 46e961d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

benchmarks/hash.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@ const algs = [
3030
]
3131

3232
algs.forEach((alg) => {
33-
suite.add(alg, function (d) {
33+
suite.add(alg, async function (d) {
3434
const buf = Buffer.alloc(10 * 1024)
3535
buf.fill(Math.ceil(Math.random() * 100))
36-
multihashing(buf, alg)
37-
.then(res => {
38-
list.push(res)
39-
d.resolve()
40-
})
41-
.catch(err => console.log(err))
36+
const res = await multihashing(buf, alg)
37+
list.push(res)
38+
d.resolve()
4239
}, {
4340
defer: true
4441
})

0 commit comments

Comments
 (0)