Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kkristof200/js_funcmeasure
measure&compare execution times
https://github.com/kkristof200/js_funcmeasure
Last synced: 10 days ago
JSON representation
measure&compare execution times
- Host: GitHub
- URL: https://github.com/kkristof200/js_funcmeasure
- Owner: kkristof200
- Created: 2020-08-25T20:57:55.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-26T10:24:08.000Z (about 4 years ago)
- Last Synced: 2024-08-10T21:15:57.828Z (3 months ago)
- Language: TypeScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Installation
```
npm install --save funcmeasure
```## Usage
```typescript
import { measure } from 'funcmeasure';function f1() { 1 + 1 }
function f2() {
var i = 5for (let _ = 0; _ < 100; _ ++) {
i = Math.pow(i, 10)
}
}let measurements = measure([f1, f2], 10000, true)
```## Result
```
Tested 2 functions, ran 10000 times each.--------------------------------------------------------------
| Function | Total Duration | Avg Duration | Score |
--------------------------------------------------------------
| f1 | 0.000309193 | 3.09e-8 | fastest |
| f2 | 0.008580814 | 8.581e-7 | 27.75x slower |
--------------------------------------------------------------
```