@kikobeats/time-span
Advanced tools
Comparing version 1.0.1 to 1.0.2
module.exports = | ||
({ start = process.hrtime.bigint(), format = n => n } = {}) => | ||
() => | ||
format(Number(process.hrtime.bigint() - start) / 1e6) | ||
({ format = n => n } = {}) => | ||
(start = process.hrtime.bigint()) => | ||
() => | ||
format(Number(process.hrtime.bigint() - start) / 1e6) |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/kikobeats/time-span", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "author": { |
@@ -18,3 +18,3 @@ # time-span | ||
const { setTimeout } = require('timers/promises') | ||
const timeSpan = require('@kikobeats/time-span') | ||
const timeSpan = require('@kikobeats/time-span')() | ||
@@ -30,3 +30,7 @@ const duration = timeSpan() | ||
```js | ||
const duration = timeSpan({ format: n => `${Math.round(n)}ms`}) | ||
const timeSpan = require('@kikobeats/time-span')({ | ||
format: n => `${Math.round(n)}ms` | ||
}) | ||
const duration = timeSpan() | ||
await setTimeout(5000) | ||
@@ -33,0 +37,0 @@ console.log(duration()) // => 5000ms |
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
4936
5
44