mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 04:40:39 -07:00
14 lines
309 B
TypeScript
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
|
|
}
|