mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
fix: do not usre mark but direct time
This commit is contained in:
parent
01de9c3889
commit
b0577a6bb5
@ -5,12 +5,15 @@ export default defineNuxtPlugin({
|
|||||||
enforce: 'pre',
|
enforce: 'pre',
|
||||||
setup (nuxtApp) {
|
setup (nuxtApp) {
|
||||||
nuxtApp.hooks.beforeEach((event) => {
|
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) => {
|
nuxtApp.hooks.afterEach((event) => {
|
||||||
performance.measure(event.name, {
|
performance.measure(event.name, {
|
||||||
start: event.name + ' start',
|
// @ts-expect-error __startTime is not a public API
|
||||||
|
start: event.__startTime,
|
||||||
detail: {
|
detail: {
|
||||||
devtools: {
|
devtools: {
|
||||||
dataType: 'track-entry',
|
dataType: 'track-entry',
|
||||||
|
Loading…
Reference in New Issue
Block a user