mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-29 05:41:03 +00:00
fix: test
This commit is contained in:
21
rust/benchmark/bench.ts
Normal file
21
rust/benchmark/bench.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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())
|
||||
Reference in New Issue
Block a user