@ircam/blocked

1.1.2 • Public • Published

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/blocked

Example

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();

Dependencies (0)

    Dev Dependencies (15)

    Package Sidebar

    Install

    npm i @ircam/blocked

    Weekly Downloads

    2

    Version

    1.1.2

    License

    BSD-3-Clause

    Unpacked Size

    119 kB

    Total Files

    8

    Last publish

    Collaborators

    • jipodine
    • norbert.schnell
    • b-ma