# elapsed-time

> nanosecond resolution `stopwatch` for node.js

Latest version **0.0.1** (published 2015-08-28) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-08-28 |
| First published | 2015-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Kirill Fomichev |
| Maintainers | fanatid |
| Keywords | elapsed, stopwatch, nanoseconds, interval, benchmark, profile, performance |

## Links

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

## Dependencies (2)

- [babel-runtime](https://npm.io/package/babel-runtime.md) ^5.8.20
- [browser-process-hrtime](https://npm.io/package/browser-process-hrtime.md) ^0.1.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2015-08-28

## README

# elapsed-time

[![build status](https://img.shields.io/travis/fanatid/elapsed-time.svg?branch=master&style=flat-square)](http://travis-ci.org/fanatid/elapsed-time)
[![Coverage Status](https://img.shields.io/coveralls/fanatid/elapsed-time.svg?style=flat-square)](https://coveralls.io/r/fanatid/elapsed-time)
[![Dependency status](https://img.shields.io/david/fanatid/elapsed-time.svg?style=flat-square)](https://david-dm.org/fanatid/elapsed-time#info=dependencies)

[![NPM](https://nodei.co/npm/elapsed-time.png)](https://www.npmjs.com/package/elapsed-time)
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

## Installation

```bash
npm install elapsed-time
```

## Examples

```js
var ElapsedTime = require('elapsed-time')
var et = ElapsedTime.new().start()
setTimeout(function () {
  console.log(et.getValue()) // should print ~ 10ms
}, 10)
```

## API

  * static
    * [new](#new)
    * [setDefaultFormatter](#setdefaultformatter)
  * methods
    * [constructor](#constructor)
    * [start](#start)
    * [pause](#pause)
    * [resume](#resume)
    * [sleep](#sleep)
    * [reset](#reset)
    * [getRawValue](#getrawvalue)
    * [getValue](#getvalue)

### new

you can use static *new* instead **new** keyword

**return**: `ElapsedTime`

### setDefaultFormatter

  * `function` formatter

### constructor

  * `Object` [opts]
    * `function` [opts.formatter]

### start

**return**: `ElapsedTime`

### pause

**return**: `ElapsedTime`

### sleep

  * `number` timeout

**return**: `ElapsedTime`

### reset

**return**: `ElapsedTime`

### getRawValue

**return**: `number`

### getValue

  * `Object` [opts]
    * `function` [opts.formatter]

**return**: `number`

## License

Code released under [the MIT license](LICENSE).

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