Home

Awesome

loopbench

Benchmark your event loop, extracted from hapi, hoek, heavy and boom.

<a name="install"></a>

Install

To install loopbench, simply use npm:

npm i loopbench --save

<a name="example"></a>

Example

See example.js.

<a name="api"></a>

API


<a name="constructor"></a>

loopbench([opts])

Creates a new instance of loopbench.

Options:

Events:


<a name="delay"></a>

instance.delay

The delay in milliseconds (and fractions) from the expected run. It might be negative (in older nodes).


<a name="limit"></a>

instance.limit

The maximum amount of delay that is tollerated before overLimit becomes true, and the load event is emitted.


<a name="overLimit"></a>

instance.overLimit

Is true if the instance.delay > instance.limit.


<a name="stop"></a>

instance.stop()

Stops the sampling.

<a name="license"></a>

License

Copyright Matteo Collina 2015-2022, Licensed under MIT.