( instance: ComponentInternalInstance, type: string, )
| 22 | } |
| 23 | |
| 24 | export function endMeasure( |
| 25 | instance: ComponentInternalInstance, |
| 26 | type: string, |
| 27 | ): void { |
| 28 | if (instance.appContext.config.performance && isSupported()) { |
| 29 | const startTag = `vue-${type}-${instance.uid}` |
| 30 | const endTag = startTag + `:end` |
| 31 | const measureName = `<${formatComponentName(instance, instance.type)}> ${type}` |
| 32 | perf.mark(endTag) |
| 33 | perf.measure(measureName, startTag, endTag) |
| 34 | perf.clearMeasures(measureName) |
| 35 | perf.clearMarks(startTag) |
| 36 | perf.clearMarks(endTag) |
| 37 | } |
| 38 | |
| 39 | if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) { |
| 40 | devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()) |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | function isSupported() { |
| 45 | if (supported !== undefined) { |
no test coverage detected