This repository was archived by the owner on Aug 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33Benchmark your JS projects with nanosecond resolution.
44
5- - Utilizes ` process.hrtime ` for 1ns resolution
6- - Colorful formatting with nice units
7- - No dependencies, only ~ 150 lines of code: as lightweight as possible to not interfere with benchmarked code
8- - No code for estimating running time - specify samples manually
9- - Shows relative margin of error, min/max runs ** only if it's high**
5+ - Precise: 1ns resolution using ` process.hrtime `
6+ - Lightweight: ~ 200 lines of code, no dependencies - to not interfere with benchmarked code
7+ - Readable: utilizes colors and nice units, shows rel. margin of error only if it's high
108
119![ ] ( https://user-images.githubusercontent.com/574696/184465244-b5784438-6af8-4a3d-abaa-03a0057768e6.png )
1210
@@ -26,12 +24,11 @@ import bench from 'micro-bmark';
2624Example output:
2725
2826```
29- getPublicKey() x 6,072 ops/sec @ 164μs/op ± 8.22% (min: 143μs, max: 17ms)
27+ getPublicKey x 6,072 ops/sec @ 164μs/op ± 8.22% [ 143μs.. 17ms]
3028sign x 4,980 ops/sec @ 200μs/op
31- signSync x 4,671 ops/sec @ 214μs/op
3229verify x 969 ops/sec @ 1ms/op
3330recoverPublicKey x 890 ops/sec @ 1ms/op
34- getSharedSecret aka ecdh x 585 ops/sec @ 1ms/op
31+ getSharedSecret x 585 ops/sec @ 1ms/op
3532```
3633
3734## License
You can’t perform that action at this time.
0 commit comments