0.0.5 • Published 5 years ago

@happycodingfriend/benchmark v0.0.5

Weekly downloads
5
License
MIT
Repository
gitlab
Last release
5 years ago

benchmark

JavaScript benchmark library

Installation

$ npm install @happycodingfriend/benchmark

Example

const Benkcmark = require('@happycodingfriend/benchmark')
const benkcmark = new Benkcmark({ times: 50 })

function add(a, b) {
    return new Promise(function (resolve) {
        setTimeout(() => {
            resolve(a + b)
        }, 50)
    })
}

benkcmark.test(add, 20, 30)
    .then(console.table)
    
/*
┌─────────┬──────────┐
│ (index) │  Values  │
├─────────┼──────────┤
│  times  │    50    │
│   avg   │ '50.2ms' │
│  stdev  │ '0.40ms' │
│ median  │  '50ms'  │
│   min   │  '50ms'  │
│   max   │  '51ms'  │
└─────────┴──────────┘
*/
0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago