https://github.com/cometkim/rescript-tinybench
ReScript bindings to tinybench
https://github.com/cometkim/rescript-tinybench
benchmark rescript rescript-bindings
Last synced: 10 months ago
JSON representation
ReScript bindings to tinybench
- Host: GitHub
- URL: https://github.com/cometkim/rescript-tinybench
- Owner: cometkim
- License: mit
- Created: 2023-01-02T20:12:39.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-10T14:45:54.000Z (over 2 years ago)
- Last Synced: 2024-10-29T14:48:03.910Z (about 1 year ago)
- Topics: benchmark, rescript, rescript-bindings
- Language: ReScript
- Homepage:
- Size: 844 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rescript-tinybench
ReScript bindings to [tinybench](https://github.com/tinylibs/tinybench)
## Usage
```res
open RescriptCore
open RescriptTinybench
let bench =
Bench.make(~time=100.0, ())
->Bench.add("switch 1", () => {
let a = ref(1)
let b = ref(2)
let c = a.contents
a := b.contents
b := c
})
->Bench.add("switch 2", () => {
let a = ref(1)
let b = ref(10)
a := b.contents + a.contents
b := a.contents - b.contents
a := b.contents - a.contents
})
await bench.run(.)
bench.table(.)->Console.table
```
## LICENSE
MIT