Socket
Socket
Sign inDemoInstall

time-span

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    time-span

Simplified high resolution timing


Version published
Weekly downloads
979K
increased by12.56%
Maintainers
1
Install size
5.58 kB
Created
Weekly downloads
 

Readme

Source

time-span Build Status

Simplified high resolution timing

Install

$ npm install --save time-span

Usage

const timeSpan = require('time-span');
const end = timeSpan();

timeConsumingFn();

console.log(end());
//=> 1745.3186

console.log(end.rounded());
//=> 1745

console.log(end.sec());
//=> 1.7453186

API

timeSpan()

Returns a function that returns the time difference:

end()

Milliseconds.

end.rounded()

Milliseconds rounded.

end.sec()

Seconds.

end.nano()

Nanoseconds.

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 10 Dec 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc