mirror of
https://github.com/hanzoai/vitest.git
synced 2026-10-30 14:46:34 +00:00
22 lines
318 B
TypeScript
22 lines
318 B
TypeScript
import { test } from 'vitest'
|
|
|
|
const options = {
|
|
time: 0,
|
|
iterations: 3,
|
|
warmupTime: 0,
|
|
warmupIterations: 0,
|
|
}
|
|
|
|
function foo() {}
|
|
class Bar {}
|
|
|
|
test('benches', async ({ bench }) => {
|
|
await bench.compare(
|
|
bench(foo, () => {}),
|
|
bench(Bar, () => {}),
|
|
bench(() => {}, () => {}),
|
|
options,
|
|
)
|
|
})
|
|
|