Skip to content

evanlucas/phr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

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)

About

Pretty print ns/op from process.hrtime()

Resources

License

Stars

Watchers

Forks

Packages

No packages published