# async-timer

> tool for measuring time of execution of async code

Latest version **1.0.0** (published 2016-04-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install async-timer
pnpm add async-timer
yarn add async-timer
bun add async-timer
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-04-05 |
| First published | 2016-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 4.2.1 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tomas Pokorny |
| Maintainers | pookong |
| Keywords | async, timer, timing |

## Links

- npm: https://www.npmjs.com/package/async-timer
- Repository: https://github.com/pookong/async-timer
- Homepage: https://github.com/pookong/async-timer#readme
- Issues: https://github.com/pookong/async-timer/issues
- npm.io page: https://npm.io/package/async-timer

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-04-05

## README

tool for measuring time of execution of async code

## START / END
```
var asyncTimer = require('async-timer');

var timer = asyncTimer();

var task = function () {
  timer.end('KEY1');
  console.log(timer.getMeasured());
}

timer.start('KEY1');
setTimeout(task, 500);
```

## WRAP
```
var asyncTimer = require('async-timer');

var timer = asyncTimer();

var task = function (next) {
  setTimeout(next, 500);
}

var callback = function (next) {
  console.log(timer.getMeasured());
}

var wrapped = timer.wrap(task, 'KEY2');
wrapped(callback);
```

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