Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

perfect-benchmark

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

perfect-benchmark

The only Node.js benchmarking library you'll need

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

perfect-benchmark

The only Node.js benchmarking library you'll need.

Example screenshot

Installation

npm install perfect-benchmark

Usage

Basic Usage

The usage of perfect-benchmark is super simple. An example can be seen below:

const benchmark = require("perfect-benchmark");

benchmark(callback => {
        // do complex computing here...

        callback();
}, "complex stuff");

Advanced Usage

By default the function passed to benchmark is called 25 times, as can be seen in the screenshot above. If you need it to be executed a different amout of times, you can set the amount via benchmark's third parameter.

If you want to specify a callback to be called after the benchmark has completed, you can pass it as a fourth parameter.

The following example demonstrates these two features.

const benchmark = require("perfect-benchmark");

benchmark(callback => {
        // do complex computing here...

        callback();
}, "complex stuff", 5, () => {  // execute 5 times
    console.log("benchmarking complete!");
});

Keywords

FAQs

Package last updated on 26 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc