# @akolos/interval-task-runner

> Repeatedly executes a function with a minimum time delay between reach call (with millisecond precision). Written in TypeScript.

Latest version **1.0.10** (published 2022-03-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @akolos/interval-task-runner
pnpm add @akolos/interval-task-runner
yarn add @akolos/interval-task-runner
bun add @akolos/interval-task-runner
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2022-03-16 |
| First published | 2020-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andrew Kolos |
| Maintainers | akolos |

## Links

- npm: https://www.npmjs.com/package/@akolos/interval-task-runner
- Repository: https://github.com/andrewkolos/tiny-node-packages.git#master
- Homepage: https://github.com/andrewkolos/tiny-node-packages/tree/master#readme
- Issues: https://github.com/andrewkolos/tiny-node-packages/issues
- npm.io page: https://npm.io/package/@akolos/interval-task-runner

## Recent versions

- 1.0.10 (latest) — 2022-03-16
- 1.0.9 — 2021-09-28
- 1.0.8 — 2020-12-26
- 1.0.7 — 2020-12-04
- 1.0.6 — 2020-06-21

## README

# IntervalTaskRunner

Repeatedly executes a function with a minimum time delay between reach call (with millisecond precision). Written in TypeScript.

# Installation and Usage

## Install
```
npm install interval-task-runner
```

## Example Usages
```JS
import { IntervalTaskRunner, Interval } from 'interval-task-runner';

const task = () => console.log('foo'); // The task to run.

// example 1
const interval = Interval.fromHz(10); // Run task approx. 10 times per second.
const runner = new IntervalTaskRunner(task, interval);
runner.start(); // Now printing 'foo' ~10 times per second.
// Later...
runner.stop(); // No longer printing 'foo'.

// example 2
const interval = Interval.fromMs(100); // Run task approx. every 100 milliseconds (or 10 Hz).
const runner = new IntervalTaskRunner(task, interval).start(); // One-liner.
runner.stop();
```
# [API](https://github.com/andrewkolos/interval-task-runner/tree/master/docs/classes)

---
_Source: https://npm.io/package/@akolos/interval-task-runner · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
