diff --git a/benchmarks/hash.js b/benchmarks/hash.js index b0ad8f92..20409ec9 100644 --- a/benchmarks/hash.js +++ b/benchmarks/hash.js @@ -30,15 +30,12 @@ const algs = [ ] algs.forEach((alg) => { - suite.add(alg, function (d) { + suite.add(alg, async function (d) { const buf = Buffer.alloc(10 * 1024) buf.fill(Math.ceil(Math.random() * 100)) - multihashing(buf, alg) - .then(res => { - list.push(res) - d.resolve() - }) - .catch(err => console.log(err)) + const res = await multihashing(buf, alg) + list.push(res) + d.resolve() }, { defer: true })