# monotonic-timestamp

> Monotonically increasing timestamp.

Latest version **0.0.9** (published 2014-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install monotonic-timestamp
pnpm add monotonic-timestamp
yarn add monotonic-timestamp
bun add monotonic-timestamp
```

## 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.9 |
| Published | 2014-08-19 |
| First published | 2012-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 45 |
| Author | 'Dominic Tarr' |
| Maintainers | dominictarr |

## Links

- npm: https://www.npmjs.com/package/monotonic-timestamp
- Repository: https://github.com/dominictarr/monotonic-timestamp
- Issues: https://github.com/dominictarr/monotonic-timestamp/issues
- npm.io page: https://npm.io/package/monotonic-timestamp

## Recent versions

- 0.0.9 (latest) — 2014-08-19
- 0.0.8 — 2013-02-04
- 0.0.7 — 2012-10-31
- 0.0.6 — 2012-10-31
- 0.0.5 — 2012-10-31
- 0.0.4 — 2012-10-31
- 0.0.3 — 2012-10-22
- 0.0.2 — 2012-10-22
- 0.0.1 — 2012-10-22

## README

# monotonic-timestamp

Monotonically increasing timestamp.

<img src=https://secure.travis-ci.org/'Dominic Tarr'/monotonic-timestamp.png?branch=master>

This is NOT a  accurate representation of the time.
Since js only measures time as ms, if you call Date.now()
twice quickly, it's possible to get two identical time stamps.

`monotonic-timestamp` fixes that problem! (crudely)

## Example

``` js
var timestamp = require('monotonic-timestamp')

console.log(timestamp())
console.log(timestamp())
console.log(timestamp())
console.log(timestamp())
console.log(timestamp())

```

subsequent calls to timestamp() are ALWAYS strictly ordered.

## byte optimizations

My precious bytes! wasted on your timestamp!

pack it into a string!
``` js
timestamp().toString(36) 
```

if you want a constant-length string, you can use [monotonic-timestamp-base36](https://github.com/nathan7/monotonic-timestamp-base36)

of course, if you are using a binary protocol, 
it will be cheaper to use the float...

##TODO

syncronize network time.

## License

MIT

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