mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-10 21:36:17 +00:00
22 lines
283 B
TypeScript
22 lines
283 B
TypeScript
import { Bench } from 'tinybench'
|
|
|
|
import { plus100 } from '../index.js'
|
|
|
|
function add(a: number) {
|
|
return a + 100
|
|
}
|
|
|
|
const b = new Bench()
|
|
|
|
b.add('Native a + 100', () => {
|
|
plus100(10)
|
|
})
|
|
|
|
b.add('JavaScript a + 100', () => {
|
|
add(10)
|
|
})
|
|
|
|
await b.run()
|
|
|
|
console.table(b.table())
|