Run benchmark independent of the component lifecycle
This commit is contained in:
parent
19212ced62
commit
e6c03a8ae0
1 changed files with 2 additions and 0 deletions
|
@ -306,6 +306,8 @@ window.__BENCH_RESULTS = new Map();
|
||||||
window.__BENCHMARK = {
|
window.__BENCHMARK = {
|
||||||
start(name) {
|
start(name) {
|
||||||
if (!import.meta.env.DEV && !import.meta.env.PHANPY_DEV) return;
|
if (!import.meta.env.DEV && !import.meta.env.PHANPY_DEV) return;
|
||||||
|
// If already started, ignore
|
||||||
|
if (BENCHES.has(name)) return;
|
||||||
const start = performance.now();
|
const start = performance.now();
|
||||||
BENCHES.set(name, start);
|
BENCHES.set(name, start);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue