@ircam/blocked
v1.1.2
Published
test for blockage in event loop
Downloads
21
Readme
Blocked
Periodic test for event loop, in the browser or in node. Callback to report each time it was blocked.
Install
npm install [--save] @ircam/blockedExample
It is the same usage within node or a web browser.
import Blocked from '@ircam/blocked';
const threshold = 100; // report blockage of more than 100 ms
const blocked = new Blocked( (duration) => {
console.log(`Blocked for ${duration} ms`);
}, threshold);
// that's it is runs in the background// in case you want to stop it:
blocked.stop();