Skip to content

Commit d126d2c

Browse files
committed
fix(core): use performance.now in supporting browsers;
- Closes #70
1 parent 988d929 commit d126d2c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ if (isNode = typeof process < 'u' && typeof process.stdout < 'u') {
2424
// attach node-specific utils
2525
write = x => process.stdout.write(x);
2626
hrtime = (now = process.hrtime()) => () => milli(process.hrtime(now));
27+
} else if (typeof performance < 'u') {
28+
hrtime = (now = performance.now()) => () => (performance.now() - now).toFixed(2) + 'ms';
2729
}
2830

2931
const QUOTE = kleur.dim('"'), GUTTER = '\n ';

0 commit comments

Comments
 (0)