Check if a node event loop is blocked.
If You're running Node.js 8+ you can get a stacktrace pointing to the blocking function using very similar blocked-at package.
$ npm install blocked
blocked() function reports every value over the configured threshold (defaulted to 10ms). You can then do whatever
you want with that value, graph it, log it, alert, etc.
The process won't be kept open through this.
Params and return value
var timer = ;
- fn: The callback function to execute when the event loop is blocked. Will send in the amount of time in ms that the event loop was blocked.
- options: Optional. Options object to configure the behaviour.
thresholddetermines the amount of ms used to determine if the function callback should be executed; useful to speed up tests.
intervaldetermines the frequency with which the event loop is checked in ms.
Returns: A reference to the timer. Useful for clearing the timer.
var timer =;;