# @kikobeats/time-span

> simple high resolution timing

Latest version **1.0.13** (published 2026-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kikobeats/time-span
pnpm add @kikobeats/time-span
yarn add @kikobeats/time-span
bun add @kikobeats/time-span
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2026-04-14 |
| First published | 2023-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 18 |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Kiko Beats |
| Maintainers | kikobeats |
| Keywords | bench, benchmark, elapsed, highres, hrtime, measure, milliseconds, perf, performance, process, profiling, span, time, timing |

## Links

- npm: https://www.npmjs.com/package/@kikobeats/time-span
- Repository: https://github.com/kikobeats/time-span
- Issues: https://github.com/kikobeats/time-span/issues
- npm.io page: https://npm.io/package/@kikobeats/time-span

## 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.13 (latest) — 2026-04-14
- 1.0.12 — 2026-03-18
- 1.0.11 — 2025-11-22
- 1.0.10 — 2025-10-14
- 1.0.9 — 2025-09-04
- 1.0.8 — 2025-08-13
- 1.0.7 — 2025-07-30
- 1.0.6 — 2025-07-03
- 1.0.5 — 2024-05-08
- 1.0.4 — 2024-02-09
- 1.0.3 — 2023-10-24
- 1.0.2 — 2023-10-08
- 1.0.1 — 2023-10-08
- 0.0.1 — 2023-10-08

## README

# time-span

![Last version](https://img.shields.io/github/tag/Kikobeats/time-span.svg?style=flat-square)
[![Coverage Status](https://img.shields.io/coveralls/Kikobeats/time-span.svg?style=flat-square)](https://coveralls.io/github/Kikobeats/time-span)
[![NPM Status](https://img.shields.io/npm/dm/@kikobeats/time-span.svg?style=flat-square)](https://www.npmjs.org/package/@kikobeats/time-span)

> A zero dependencies high resolution timing function.

## Install

```bash
$ npm install @kikobeats/time-span --save
```

## Usage

```js
const { setTimeout } = require('timers/promises')
const timeSpan = require('@kikobeats/time-span')()

const duration = timeSpan()
await setTimeout(5000)

console.log(duration()) // => 5001.870375
```

It also accepts a `format` function:

```js
const timeSpan = require('@kikobeats/time-span')({
  format: n => `${Math.round(n)}ms`
})

const duration = timeSpan()
await setTimeout(5000)
console.log(duration()) // => 5000ms
```

## License

**time-span** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/time-span/blob/master/LICENSE.md) License.<br>
Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/Kikobeats/time-span/contributors).

> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · X [@Kikobeats](https://x.com/Kikobeats)

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