phr

1.0.1 • Public • Published

phr

Build Status Coverage Status

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
}
 
= 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)

Readme

Keywords

none

Package Sidebar

Install

npm i phr

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • eh
  • evanlucas