JSPM

elapsed-time

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1608
  • Score
    100M100P100Q111935F
  • License MIT

nanosecond resolution `stopwatch` for node.js

Package Exports

  • elapsed-time
  • elapsed-time/lib/hrtime-browser.js
  • elapsed-time/lib/hrtime.js
  • elapsed-time/src/hrtime-browser.js
  • elapsed-time/src/hrtime.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (elapsed-time) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.