Gathering detailed insights and metrics for benchmark
Gathering detailed insights and metrics for benchmark
Gathering detailed insights and metrics for benchmark
Gathering detailed insights and metrics for benchmark
@types/benchmark
TypeScript definitions for benchmark
pretty-hrtime
process.hrtime() to words
tinybench
[](https://github.com/tinylibs/tinybench/actions/workflows/qa.yml) [](https://www.npmjs.com/package/tinyb
@shopgate/pwa-benchmark
Benchmark suite for PWA
npm install benchmark
Typescript
Module System
Node Version
NPM Version
98.7
Supply Chain
97.7
Quality
78.1
Maintenance
100
Vulnerability
99.6
License
JavaScript (88.24%)
HTML (7.28%)
CSS (4.41%)
Shell (0.08%)
Total Downloads
128,379,618
Last Day
52,942
Last Week
571,393
Last Month
2,424,527
Last Year
17,242,198
NOASSERTION License
5,488 Stars
1,171 Commits
329 Forks
97 Watchers
19 Branches
19 Contributors
Updated on Jun 10, 2025
Latest Version
2.1.4
Package Id
benchmark@2.1.4
Size
22.59 kB
NPM Version
4.4.1
Node Version
7.7.2
Published on
Mar 28, 2017
Cumulative downloads
Total Downloads
Last Day
-13%
52,942
Compared to previous day
Last Week
-14%
571,393
Compared to previous week
Last Month
7.3%
2,424,527
Compared to previous month
Last Year
40.5%
17,242,198
Compared to previous year
A robust benchmarking library that supports high-resolution timers & returns statistically significant results. As seen on jsPerf.
Benchmark.js’ only hard dependency is lodash. Include platform.js to populate Benchmark.platform.
In a browser:
1<script src="lodash.js"></script> 2<script src="platform.js"></script> 3<script src="benchmark.js"></script>
In an AMD loader:
1require({ 2 'paths': { 3 'benchmark': 'path/to/benchmark', 4 'lodash': 'path/to/lodash', 5 'platform': 'path/to/platform' 6 } 7}, 8['benchmark'], function(Benchmark) {/*…*/});
Using npm:
1$ npm i --save benchmark
In Node.js:
1var Benchmark = require('benchmark');
Optionally, use the microtime module by Wade Simmons:
1npm i --save microtime
Usage example:
1var suite = new Benchmark.Suite; 2 3// add tests 4suite.add('RegExp#test', function() { 5 /o/.test('Hello World!'); 6}) 7.add('String#indexOf', function() { 8 'Hello World!'.indexOf('o') > -1; 9}) 10// add listeners 11.on('cycle', function(event) { 12 console.log(String(event.target)); 13}) 14.on('complete', function() { 15 console.log('Fastest is ' + this.filter('fastest').map('name')); 16}) 17// run async 18.run({ 'async': true }); 19 20// logs: 21// => RegExp#test x 4,161,532 +-0.99% (59 cycles) 22// => String#indexOf x 6,139,623 +-1.00% (131 cycles) 23// => Fastest is String#indexOf
Tested in Chrome 54-55, Firefox 49-50, IE 11, Edge 14, Safari 9-10, Node.js 6-7, & PhantomJS 2.1.1.
Benchmark.js is part of the BestieJS “Best in Class” module collection. This means we promote solid browser/environment support, ES5+ precedents, unit testing, & plenty of documentation.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 7/30 approved changesets -- score normalized to 2
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
46 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-09
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More