A [robust](http://calendar.perfplanet.com/2010/bulletproof-javascript-benchmarks/ "Bulletproof JavaScript benchmarks") benchmarking library that works on nearly all JavaScript platforms<sup><a name="fnref1" href="#fn1">1</a></sup>, supports high-resolution timers, and returns statistically significant results. As seen on [jsPerf](http://jsperf.com/).
## BestieJS
Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
## Documentation
The documentation for Benchmark.js can be viewed here: <http://benchmarkjs.com/docs>
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/benchmark.js/wiki/Roadmap).
## Support
Benchmark.js has been tested in at least Adobe AIR 3.1, Chrome 5-21, Firefox 1.5-13, IE 6-9, Opera 9.25-12.01, Safari 3-6, Node.js 0.8.6, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
## Installation and usage
In a browser or Adobe AIR:
~~~ html
<script src="benchmark.js"></script>
~~~
Optionally, expose Java’s nanosecond timer by adding the `nano` applet to the `<body>`:
~~~ html
<applet code="nano" archive="nano.jar"></applet>
~~~
Or enable Chrome’s microsecond timer by using the [command line switch](http://peter.sh/experiments/chromium-command-line-switches/#enable-benchmarking):
--enable-benchmarking
Via [npm](http://npmjs.org/):
~~~ bash
npm install benchmark
~~~
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
~~~ js
var Benchmark = require('benchmark');
~~~
Optionally, use the [microtime module](https://github.com/wadey/node-microtime) by Wade Simmons:
~~~ bash
npm install microtime
~~~
In [RingoJS v0.7.0-](http://ringojs.org/):
~~~ js
var Benchmark = require('benchmark').Benchmark;
~~~
In [Rhino](http://www.mozilla.org/rhino/):
~~~ js
load('benchmark.js');
~~~
In an AMD loader like [RequireJS](http://requirejs.org/):
[![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")