mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(kit): provide name to performance.mark()
(#19687)
This commit is contained in:
parent
f9d7e1c900
commit
886cca19ea
@ -68,9 +68,10 @@ export function defineNuxtModule<OptionsT extends ModuleOptions> (definition: Mo
|
||||
}
|
||||
|
||||
// Call setup
|
||||
const mark = performance.mark()
|
||||
const key = `nuxt:module:${uniqueKey || (Math.round(Math.random() * 10000))}`
|
||||
const mark = performance.mark(key)
|
||||
const res = await definition.setup?.call(null as any, _options, nuxt) ?? {}
|
||||
const perf = performance.measure(`nuxt:module:${uniqueKey || (Math.round(Math.random() * 10000))}`, mark.name)
|
||||
const perf = performance.measure(key, mark.name)
|
||||
const setupTime = Math.round((perf.duration * 100)) / 100
|
||||
|
||||
// Measure setup time
|
||||
|
Loading…
Reference in New Issue
Block a user