phr
v1.0.1
Published
Pretty print ns/op from process.hrtime()
Downloads
6
Readme
phr
Pretty print ns/op from process.hrtime()
Install
$ npm install phr
Test
$ npm test
Usage
const phr = require('phr')
const ITER = 1e6
var h = process.hrtime()
// benchmark ns/op
for (var i = 0; i < ITER; i++) {
var a = {}
a.a = 1
a.b = 2
}
h = process.hrtime(h)
console.log('bench', phr(h, ITER, 1), 'ns/op')
// => bench 30.1 ns/op
API
PHR(h, ITER, places)
- h pass in process.hrtime
- ITER number of iterations
- places number of places to format
Author
Evan Lucas
License
MIT (See LICENSE
for more info)