Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 51x 51x 34x 17x | /** * Wrapper around the performance markers api * * @class Performance */ import { hasOwn } from './utils' export class Performance { static hasPerformanceApi () { const p = typeof window !== 'undefined' && hasOwn(window, 'performance') return p && p.mark && p.measure && p.clearMarks && p.clearMeasures } static mark (tag) { Iif (Performance.hasPerformanceApi()) { window.performance.mark(tag) } } static measure (name, from, to) { Iif (Performance.hasPerformanceApi()) { window.performance.measure(name, from, to) window.performance.clearMarks(from) window.performance.clearMarks(to) } } } |