3.0.0 • Published 4 years ago

ops-per-sec v3.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

ops-per-sec NPM version js-standard-style

Quickly test ops per second of a function

Warning - eval like stuff going on in cli yo

When using the cli your string will be interpreted using Node's vm in a sandboxed context. I'm no expert on the dangers of that, but it's always better to be safe than sorry. Don't be dumb with that.

"eval is evil" - some smart dude

Install

node

$ npm install --save ops-per-sec

cli

$ npm install -g ops-per-sec

Usage

const opsPerSec = require('ops-per-sec')
let ops = opsPerSec(() => ['some', 'text', 'in'].includes('text'), 3000, true)
console.log(`${ops} ops/sec`)
$ ops-per-sec "() => ['some', 'text', 'in'].includes('text')" 3000 true

API

opsPerSec(*func, *expect, *runForMs)

License

MIT © Andrew Carpenter

3.0.0

4 years ago

2.2.0

4 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.0

7 years ago