Socket
Socket
Sign inDemoInstall

@kikobeats/time-span

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kikobeats/time-span

simple high resolution timing


Version published
Weekly downloads
7.3K
increased by15.96%
Maintainers
1
Weekly downloads
 
Created
Source

time-span

Last version 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

Keywords

FAQs

Package last updated on 24 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc