# busy-loop

> Detect if event loop is busy.

Latest version **0.0.1** (published 2015-08-05) · 0 weekly downloads

## Install

```sh
npm install busy-loop
pnpm add busy-loop
yarn add busy-loop
bun add busy-loop
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-08-05 |
| First published | 2015-08-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Michal Brašna |
| Maintainers | gobie |
| Keywords | event, loop, busy |

## Links

- npm: https://www.npmjs.com/package/busy-loop
- Repository: https://github.com/Gobie/busy-loop
- Homepage: https://github.com/Gobie/busy-loop#readme
- Issues: https://github.com/Gobie/busy-loop/issues
- npm.io page: https://npm.io/package/busy-loop

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2015-08-05

## README

## Detect if event loop is busy.

## Example

    var busyLoop = require('busy-loop'),

    busyLoop(function(amount) {
        console.log('Loop was busy for', amount, 'ms');
    });

## Api `busy([options], callback)`

Optional options:

    - `max` max time in ms alowed to be busy, default is 50ms
    - `interval` how often to check the state in ms, default is 1000ms

Optional callback is called every time the event loop was busy for longer amount of time than defined in `max`. Passed value is amount of ms the loop was blocked for.

---
_Source: https://npm.io/package/busy-loop · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
