benchmark
.add(
new Test('Sleep', async() => {
await sleep(10000)
}))
const results: Array<[string, Stats]> = await benchmark.run();
for (let result of results) {
console.log("Test name: " + result[0])
console.log("Test stats: ")
console.log(result[1])
}
This code prints the results before the sleep promise was resolved. How to use benchmark with async calls?
This code prints the results before the sleep promise was resolved. How to use benchmark with async calls?