# execution-time

> ultility to measure execution time

Latest version **1.4.1** (published 2020-02-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install execution-time
pnpm add execution-time
yarn add execution-time
bun add execution-time
```

## 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.4.1 |
| Published | 2020-02-04 |
| First published | 2017-05-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Venkat Reddy |
| Maintainers | svenkatreddynpm |
| Keywords | hrtime, execution, time, performance, perf, speed |

## Links

- npm: https://www.npmjs.com/package/execution-time
- Repository: https://github.com/svenkatreddy/execution-time
- Homepage: https://github.com/svenkatreddy/execution-time#readme
- Issues: https://github.com/svenkatreddy/execution-time/issues
- npm.io page: https://npm.io/package/execution-time

## Dependencies (1)

- [pretty-hrtime](https://npm.io/package/pretty-hrtime.md) ^1.0.3

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.4.1 (latest) — 2020-02-04
- 1.3.0 — 2018-10-12
- 1.2.0 — 2017-05-26
- 1.1.0 — 2017-05-26
- 1.0.0 — 2017-05-26

## README

# execution-time

[![Build Status](https://travis-ci.org/svenkatreddy/execution-time.svg?branch=master)](https://travis-ci.org/svenkatreddy/execution-time)

[![NPM](https://nodei.co/npm/execution-time.png?stars=true)](https://nodei.co/npm/execution-time/)

node.js utility to measure execution time in code

## Install
```
npm install execution-time --save
```

## Usage
```
const perf = require('execution-time')();

//at beginning of your code
perf.start();

//at end of your code
const results = perf.stop();
console.log(results.time);  // in milliseconds
```

### Named performance measurer
```
const perf = require('execution-time')();

//at beginning of your code, pass any name
perf.start('apiCall');

//at end of your code, pass the same name (anywhere in your flow)
const results = perf.stop('apiCall');
console.log(results.time);  // in milliseconds
console.log(results.preciseWords);  // in words


```

### if you dont care about results but just want to print results

sample usage with debug
```
const debug = require('debug')('your-module');
const perf = require('execution-time')(debug);

//at beginning of your code
perf.start();

//at end of your code
perf.stop();

```

also works with console.log/info/warn

```
const perf = require('execution-time')(console.log);

//at beginning of your code
perf.start();

//at end of your code
perf.stop();

```

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