Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

bench-press

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bench-press

Benchmark operations

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

bench-press

Benchmark operations

Use

import benchpress from 'bench-press';

console.log(
    benchpress(() => myFunction())
);

// Running 1000 times took 54ms

Options

Message

console.log(
    benchpress(
        () => myFunction(),
        {
            message: 'myFunction ✖ ${iterations} = ${duration}',
        }
    )
);

// myFunction ✖ 1000 = 54

Iterations

console.log(
    benchpress(
        () => myFunction(),
        {
            iterations: 1e5,
        }
    )
);

// Running 100000 times took 54ms

FAQs

Package last updated on 30 May 2018

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