Run benchmark independent of the component lifecycle

This commit is contained in:
Lim Chee Aun 2024-09-08 23:13:11 +08:00
parent 19212ced62
commit e6c03a8ae0

View file

@ -306,6 +306,8 @@ window.__BENCH_RESULTS = new Map();
window.__BENCHMARK = {
start(name) {
if (!import.meta.env.DEV && !import.meta.env.PHANPY_DEV) return;
// If already started, ignore
if (BENCHES.has(name)) return;
const start = performance.now();
BENCHES.set(name, start);
},