mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 12:18:30 +03:00
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 = {
|
||||
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);
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue