micro-bmark

Benchmark your JS projects with nanosecond resolution

Switch to "@paulmillr/jsbt"
Last updated a year ago by paulmillr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install micro-bmark 
SYNC missed versions from official npm registry.

micro-bmark

Benchmark your JS projects with nanosecond resolution.

  • Precise: 1ns resolution using process.hrtime
  • Lightweight: ~200 lines of code, no dependencies - to not interfere with benchmarked code
  • Readable: utilizes colors and nice units, shows rel. margin of error only if it's high

Usage

npm install --save-dev micro-bmark
import bench from 'micro-bmark';
(async () => {
  await bench('printing', () => Promise.resolve(0));
  await bench('base', () => Promise.resolve(1));
  await bench('sqrt', 10000, () => Math.sqrt(2));
})();

Example output:

getPublicKey x 6,072 ops/sec @ 164μs/op ± 8.22% [143μs..17ms]
sign x 4,980 ops/sec @ 200μs/op
verify x 969 ops/sec @ 1ms/op
recoverPublicKey x 890 ops/sec @ 1ms/op
getSharedSecret x 585 ops/sec @ 1ms/op

License

MIT License

Copyright (c) 2020 Paul Miller (https://paulmillr.com), (c) 2010-2016 Mathias Bynens, John-David Dalton, (c) Robert Kieffer from JSLitmus.js

Current Tags

  • 0.4.2                                ...           latest (a year ago)

10 Versions

  • 0.4.2 [deprecated]           ...           a year ago
  • 0.4.1 [deprecated]           ...           2 years ago
  • 0.4.0 [deprecated]           ...           2 years ago
  • 0.3.1 [deprecated]           ...           4 years ago
  • 0.3.0 [deprecated]           ...           4 years ago
  • 0.2.1 [deprecated]           ...           4 years ago
  • 0.2.0 [deprecated]           ...           4 years ago
  • 0.1.3 [deprecated]           ...           6 years ago
  • 0.1.2 [deprecated]           ...           7 years ago
  • 0.1.1 [deprecated]           ...           7 years ago
Maintainers (1)
Downloads
Total 10
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 2
Last Month 0
Dependencies (0)
None
Dev Dependencies (4)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE