# minimal-timer

> Minimal time tracker.

Latest version **4.1.0** (published 2017-07-07) · M.I.T license · 0 weekly downloads

## Install

```sh
npm install minimal-timer
pnpm add minimal-timer
yarn add minimal-timer
bun add minimal-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 | 4.1.0 |
| Published | 2017-07-07 |
| First published | 2017-07-03 |
| Weekly downloads | 0 |
| License | M.I.T |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Alvaro Bernal Gimeno |
| Maintainers | alvarob |
| Keywords | timer, minimal, stopwatch, time, tracker, tracking, chronometer, clock, miliseconds |

## Links

- npm: https://www.npmjs.com/package/minimal-timer
- Repository: https://github.com/alvarobernalg/minimal-timer
- Homepage: https://github.com/alvarobernalg/minimal-timer.git
- Issues: https://github.com/alvarobernalg/minimal-timer/issues
- npm.io page: https://npm.io/package/minimal-timer

## 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

- 4.1.0 (latest) — 2017-07-07
- 4.0.0 — 2017-07-07
- 3.3.0 — 2017-07-06
- 3.2.0 — 2017-07-06
- 3.1.0 — 2017-07-06
- 3.0.0 — 2017-07-06
- 2.2.0 — 2017-07-05
- 2.1.0 — 2017-07-05
- 2.0.0 — 2017-07-05
- 1.6.0 — 2017-07-03
- 1.5.0 — 2017-07-03
- 1.0.0 — 2017-07-03
- 0.2.0 — 2017-07-03
- 0.1.0 — 2017-07-03

## README

# minimal-timer 
> Keeps track of the elapsed time in miliseconds.

[![Build Status](https://travis-ci.org/AlvaroBernalG/minimal-timer.svg?branch=master)](https://travis-ci.org/AlvaroBernalG/minimal-timer) [![npm version](https://badge.fury.io/js/minimal-timer.svg)](https://badge.fury.io/js/minimal-timer) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```
$ npm install minimal-timer --save
```

## Usage 

```js
const delay = require('delay')
const timer = require('minimal-timer')

const time = timer() // instantiates the timer

time.start()

await delay(500)

console.log(time.elapsedTime()) // => 500 +- 

time.stop()

await delay(500)

console.log(time.elapsedTime()) // => 500 +- 

time.resume()

await delay(500)

console.log(time.elapsedTime()) // => 1000 +- 

```

## API

### timer() `object`

Creates a new instance 

### start(customStartDate[optional]) `void`

Starts/Restart the timer

customStartDate `Date` [optional]

### resume() `void`

Resumes the timer.

### stop() `number`

Stops the timer 

Returns the elapsed time in miliseconds

### elapsedTime() `number` 

Returns the elapased between the start time and the current  time in miliseconds

### isRunning() `boolean` 

Returns true if the timer is running otherwise false 

## License
MIT © [Alvaro Bernal](https://github.com/AlvaroBernalG/)

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