Skip to content

Commit

Permalink
feat: improve performance measuring
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsaplin committed Dec 18, 2023
1 parent 0b34331 commit 9241185
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions solutions/scripts/aem-perf-marks.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ const observer = new MutationObserver((mutations) => {
const name = target.dataset.blockName;
const status = target.dataset.blockStatus;
if (status === 'loading') {
console.debug('creating performance mark', name); // eslint-disable-line no-console
window.PerfMarks.create(name);
} else if (status === 'loaded') {
console.debug('measuring performance mark', name); // eslint-disable-line no-console
window.PerfMarks.measure(name);
}
}
Expand Down

0 comments on commit 9241185

Please sign in to comment.