Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

durations

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

durations - npm Package Compare versions

Comparing version 3.2.0 to 3.2.1

2

package.json

@@ -10,3 +10,3 @@ {

],
"version": "3.2.0",
"version": "3.2.1",
"author": "Joel Edwards (https://github.com/joeledwards)",

@@ -13,0 +13,0 @@ "contributors": [

@@ -30,11 +30,11 @@

```coffeescript
durations = require 'durations'
{duration, stopwatch, time: timeSync, timeAsync} = require 'durations'
nanoseconds = 987654321
console.log "Duration is", durations.duration(nanoseconds).format()
console.log "Duration is", duration(nanoseconds).format()
# Or, since toString() is an alias to format()
console.log "Duration is #{durations.duration(nanoseconds)}"
console.log "Duration is #{duration(nanoseconds)}"
watch = durations.stopwatch()
watch = stopwatch()
watch.stop() # Pauses the stopwatch. Returns the stopwatch.

@@ -52,3 +52,3 @@ watch.start() # Starts the stopwatch from where it was last stopped. Returns the stopwatch.

console.log "Took #{durations.time(someFunction)} to do something"
console.log "Took #{timeSync(someFunction)} to do something"

@@ -60,6 +60,5 @@ # Asynchronous work

durations.timeAsync someOtherFunction, (duration) ->
timeAsync someOtherFunction, (duration) ->
console.log "Took #{duration} to do something else."
```

@@ -69,7 +68,3 @@ Compatibilty

The `durations` module uses the `browser-process-hrtime` module in order to
support both Node.js and browsers. When using Node.js, the nanosecond-granulatiry
`process.hrtime()` function is used. The best substitution is selected when
in the browser such that consistency is maintained even if time granularity
cannot be.
The `durations` module supports both Node.js and browsers. When using Node.js, the nanosecond-granulatiry `process.hrtime()` function is used. The best substitution is selected when in the browser such that consistency is maintained even if time granularity cannot be.

Sorry, the diff of this file is not supported yet

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