From b0577a6bb5fa9b36080a265d6838c0a6de2eba0d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 14 Nov 2024 21:27:43 +0100 Subject: [PATCH] fix: do not usre mark but direct time --- .../nuxt/src/app/plugins/browser-devtools-timing.client.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/plugins/browser-devtools-timing.client.ts b/packages/nuxt/src/app/plugins/browser-devtools-timing.client.ts index 07c1f251b5..c740238880 100644 --- a/packages/nuxt/src/app/plugins/browser-devtools-timing.client.ts +++ b/packages/nuxt/src/app/plugins/browser-devtools-timing.client.ts @@ -5,12 +5,15 @@ export default defineNuxtPlugin({ enforce: 'pre', setup (nuxtApp) { nuxtApp.hooks.beforeEach((event) => { - performance.mark(event.name + ' start') + // @ts-expect-error __startTime is not a public API + event.__startTime = performance.now() }) + // After each nuxtApp.hooks.afterEach((event) => { performance.measure(event.name, { - start: event.name + ' start', + // @ts-expect-error __startTime is not a public API + start: event.__startTime, detail: { devtools: { dataType: 'track-entry',