Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qard/benchwarmer
Lightweight benchmarking suite
https://github.com/qard/benchwarmer
Last synced: 12 days ago
JSON representation
Lightweight benchmarking suite
- Host: GitHub
- URL: https://github.com/qard/benchwarmer
- Owner: Qard
- License: mit
- Created: 2024-08-02T06:24:23.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-04T01:24:46.000Z (4 months ago)
- Last Synced: 2024-10-19T19:55:42.934Z (about 1 month ago)
- Language: TypeScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# benchwarmer
A lightweight benchmarking tool for Node.js.
## Installation
```bash
npm install benchwarmer
```## Usage
```javascript
import { bench } from 'benchwarmer'bench('my group', (b) => {
b.measure('fast', () => {
// do some fast things...
})b.measure('slow', () => {
// do some slow things...
})
})
```Output:
```
# my group
fast - 9.15m i/s (±1088.20%) (109.24ns/i)
slow - 7.89m i/s (±884.15%) (126.79ns/i)
Comparing...
- fast (fastest)
- slow (16.06% slower)
```