Comparing version 3.2.0 to 3.2.1
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
12432
67