# supertime

> Simple timer module with nanotim precission

Latest version **1.0.0** (published 2017-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install supertime
pnpm add supertime
yarn add supertime
bun add supertime
```

## 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 | 2017-09-09 |
| First published | 2017-09-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andi Heinkelein |
| Maintainers | andifeind |
| Keywords | time, timer, timeing, supertime, supertimer, counter, countdown |

## Links

- npm: https://www.npmjs.com/package/supertime
- Repository: https://github.com/Andifeind/supertime
- Homepage: https://github.com/Andifeind/supertime#readme
- Issues: https://github.com/Andifeind/supertime/issues
- npm.io page: https://npm.io/package/supertime

## 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.0.0 (latest) — 2017-09-09

## README

Supertime
=========

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

High precision timer module for node.js.
It calculates a timespan in nanosecond precision.

```js
const supertime = require('supertime')

// start a timer
const timer = supertime.start()

// do some fancy stuff
const sum = 1 + 1
if (sum === 2) {
  result = 'yeah!'
}

const duration = timer.stop()

console.log(`My high complex calculation took ${duration}`)
```

The `supertime.start()` method returns a `Supertime` object which represents the timer.
To stop a timer, call `timer.stop()`. It returns a duration object, which contains the timespan in nanoseconds and returns the timespan as readable string if it gets converted into a string.

```js
const supertime = require('supertime')

// start a timer
const timer = supertime.start()

// do some fancy stuff

const duration = timer.stop()

console.log(duration.time) // logs the timespan in nanoseconds
console.log(duration) // logs the timespan as a readable string
```

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