# promise.ms

> ![](https://img.shields.io/bundlephobia/min/promise.ms?label=size&style=flat-square) ![](https://img.shields.io/npm/dt/promise.ms?style=flat-square) ![](https://img.shields.io/npm/v/promise.ms?style=flat-square)

Latest version **1.0.0** (published 2022-09-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install promise.ms
pnpm add promise.ms
yarn add promise.ms
bun add promise.ms
```

## 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 | 2022-09-06 |
| First published | 2022-09-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ephf |
| Maintainers | ephf |
| Keywords | ms, promise |

## Links

- npm: https://www.npmjs.com/package/promise.ms
- npm.io page: https://npm.io/package/promise.ms

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [@mikemajesty/zod-mock-schema](https://npm.io/package/@mikemajesty/zod-mock-schema.md) — 0 weekly downloads
- [vue-scroll-active-toc](https://npm.io/package/vue-scroll-active-toc.md) — 0 weekly downloads
- [@govuk-pay/run-amock](https://npm.io/package/@govuk-pay/run-amock.md) — 0 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-09-06

## README

# Promise ms

![](https://img.shields.io/bundlephobia/min/promise.ms?label=size&style=flat-square) ![](https://img.shields.io/npm/dt/promise.ms?style=flat-square) ![](https://img.shields.io/npm/v/promise.ms?style=flat-square)

⌚ A light-weight package for timing promises

---

## Usage

```bash
$ npm install promise.ms
```

```html
<script src="https://unpkg.com/promise.ms"></script> <!-- Client Side -->
```

After installing, import `promise.ms` (nodejs only)

```js
require("promise.ms");
```

You can use the prototype `ms` on any promise to get the amount of milliseconds a promise took to resolve

```js
promise.ms((ms) => {
  console.log("time:", ms);
});

// or

(async () => {
  const ms = await promise.ms();
  console.log("time:", ms);
})();
```

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