Files
liquidjs/src/util/performance.ts
T

14 lines
309 B
TypeScript

interface LiquidPerformance {
now: () => number
}
const polyfill: LiquidPerformance = {
now: () => Date.now()
}
export function getPerformance (): LiquidPerformance {
return (typeof global === 'object' && global.performance) ||
(typeof window === 'object' && window.performance) ||
polyfill
}