perf-helpers
v0.1.1
Published
Performance helpers for NodeJS
Downloads
4
Readme
Perf Helpers for Nodejs
Inspiration
https://gist.github.com/nijikokun/7077141
Usage
Installation
npm i perf-helpers
Import
CommonJS
const perfHelpers = require('perf-helpers');
ES 6
import * as perfHelpers = require('perf-helpers');
Benchmark
You can also destructure the helper you want to use liks so
const { benchmark } = require('perf-helpers');
or
import { benchmark } from 'perf-helpers'
Usage
benchmark(function (next) {
console.log('Hello World');
next(function (start, end, difference) {
console.log('Processed in under: ' + difference.seconds + 's!');
});
});
Available Perf Helpers
- Benchmark
Test
npm run test