nanotiming
Advanced tools
Comparing version 6.0.0 to 6.1.0
var onIdle = require('on-idle') | ||
var assert = require('assert') | ||
var perf = typeof window !== 'undefined' && window.performance | ||
var hasWindow = typeof window !== 'undefined' | ||
var disabled = hasWindow && window.localStorage.DISABLE_NANOTIMING === 'true' | ||
var perf = hasWindow && window.performance | ||
var hasPerf = perf && perf.mark | ||
@@ -12,3 +14,3 @@ | ||
if (!hasPerf) return noop | ||
if (!hasPerf || disabled) return noop | ||
@@ -15,0 +17,0 @@ var uuid = (perf.now() * 100).toFixed() |
@@ -5,3 +5,3 @@ { | ||
"repository": "yoshuawuyts/nanotiming", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"scripts": { | ||
@@ -8,0 +8,0 @@ "deps": "dependency-check . && dependency-check . --extra --no-dev", |
@@ -36,2 +36,10 @@ # nanotiming [![stability][0]][1] | ||
## Disabling timings | ||
Performance timers are still a somewhat experimental technology. While they're | ||
a great idea conceptually, there might be bugs. To disable timings complete, | ||
set: | ||
```js | ||
window.localStorage.DISABLE_NANOTIMING = true | ||
``` | ||
## API | ||
@@ -38,0 +46,0 @@ ### `endTiming = nanotiming(name)` |
5425
30
71