Socket
Socket
Sign inDemoInstall

ns-elapsed

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ns-elapsed

Simple, nanosecond resolution 'stopwatch' for nodeJS. Ideal for benchmark times.


Version published
Weekly downloads
823
decreased by-2.6%
Maintainers
1
Install size
2.81 kB
Created
Weekly downloads
 

Readme

Source

ns-elapsed

Simple, high resolution stopwatch for nodeJS. Ideal for benchmark times.

Build Status

examples

Asynchronous example

var Elapsed() = require('ns-elapsed')
var e = new Elapsed()
e.set() // This is superfluous because 'set()' is automatically called when 'e' was constructed.
setTimeout(function() { // Asynchronous code here
	console.log( e.get() )
}, 1000)

Synchronous example:

var elapsed = require('ns-elapsed')()
// Synchronous code here
console.log( e.get() )

api

var Elapsed = require('ns-elapsed')

var e = new Elapsed()

e.set()

Does not return anything. Automatically called upon construction.

var sec = e.get()

Returns the number of seconds elapsed. E.g. 13.947172826, which is almost 14 seconds.

install

Install with NPM

npm install ns-elapsed

license

MIT

Keywords

FAQs

Last updated on 11 Mar 2016

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