Socket
Socket
Sign inDemoInstall

elapsed-time

Package Overview
Dependencies
3
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

elapsed-time

nanosecond resolution `stopwatch` for node.js


Version published
Maintainers
1
Weekly downloads
2,272
decreased by-6.62%

Weekly downloads

Readme

Source

elapsed-time

build status Coverage Status Dependency status

NPM js-standard-style

Installation

npm install elapsed-time

Examples

var ElapsedTime = require('elapsed-time')
var et = ElapsedTime.new().start()
setTimeout(function () {
  console.log(et.getValue()) // should print ~ 10ms
}, 10)

API

new

you can use static new instead new keyword

return: ElapsedTime

setDefaultFormatter

  • function formatter

constructor

  • Object [opts]
    • function [opts.formatter]

start

return: ElapsedTime

pause

return: ElapsedTime

sleep

  • number timeout

return: ElapsedTime

reset

return: ElapsedTime

getRawValue

return: number

getValue

  • Object [opts]
    • function [opts.formatter]

return: number

License

Code released under the MIT license.

Keywords

FAQs

Last updated on 28 Aug 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