Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@kikobeats/time-span

kikobeats170.2kMIT1.0.5

simple high resolution timing

bench, benchmark, elapsed, highres, hrtime, measure, milliseconds, perf, performance, process, profiling, span, time, timing

readme

time-span

Last version Coverage Status NPM Status

A zero dependencies high resolution timing function.

Install

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

Usage

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:

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, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

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)

1.0.0 (2023-10-08)

0.0.1 (2023-10-08)