napi-rs/bench/async.ts
2020-09-30 15:31:17 +08:00

15 lines
299 B
TypeScript

import b from 'benny'
const { benchAsyncTask } = require('./index.node')
const buffer = Buffer.from('hello 🚀 rust!')
export const benchAsync = () =>
b.suite(
'Async task',
b.add('napi-rs', async () => {
await benchAsyncTask(buffer)
}),
b.cycle(),
b.complete(),
)