### Install loopbench Source: https://github.com/mcollina/loopbench/blob/master/README.md Install loopbench using npm. This command saves the package as a dependency. ```bash npm i loopbench --save ``` -------------------------------- ### loopbench() constructor Source: https://github.com/mcollina/loopbench/blob/master/README.md Creates a new instance of loopbench. It accepts an optional configuration object to set the sample interval and the delay limit. ```APIDOC ## loopbench([opts]) ### Description Creates a new instance of loopbench. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * `opts` (object) - Optional configuration object. * `sampleInterval` (number) - The interval at which the eventLoop should be sampled. Defaults to 5. * `limit` (number) - The maximum amount of delay that is tolerated before `overLimit` becomes true. Defaults to 42. ### Events * `load`: Emitted when `instance.delay > instance.limit`. * `unload`: Emitted when `overLimit` goes from `true` to `false`. ``` -------------------------------- ### instance.limit Source: https://github.com/mcollina/loopbench/blob/master/README.md A property representing the maximum tolerated delay. When the `instance.delay` exceeds this limit, the `overLimit` property becomes true and the 'load' event is emitted. ```APIDOC ## instance.limit ### Description The maximum amount of delay that is tolerated before `overLimit` becomes true, and the `load` event is emitted. ### Parameters None ### Return Value * (number) - The configured delay limit. ``` -------------------------------- ### instance.stop() Source: https://github.com/mcollina/loopbench/blob/master/README.md Stops the event loop sampling process initiated by the loopbench instance. ```APIDOC ## instance.stop() ### Description Stops the sampling. ### Parameters None ### Return Value None. ``` -------------------------------- ### instance.delay Source: https://github.com/mcollina/loopbench/blob/master/README.md A property that exposes the current event loop delay in milliseconds. This value can be negative in older Node.js versions. ```APIDOC ## instance.delay ### Description The delay in milliseconds (and fractions) from the expected run. It might be negative (in older nodes). ### Parameters None ### Return Value * (number) - The current event loop delay. ``` -------------------------------- ### instance.overLimit Source: https://github.com/mcollina/loopbench/blob/master/README.md A boolean property that is true if the current event loop delay (`instance.delay`) is greater than the configured limit (`instance.limit`). ```APIDOC ## instance.overLimit ### Description Is `true` if the `instance.delay > instance.limit`. ### Parameters None ### Return Value * (boolean) - `true` if the delay exceeds the limit, `false` otherwise. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.