blob: 1c87ee2086e5e2711e22571b105a3a50d68b60cd (
plain)
1
2
3
4
5
6
7
8
9
10
|
export const performanceMarkAndMeasure = ({ mark, measures = [] } = {}) => {
window.requestAnimationFrame(() => {
if (mark && !performance.getEntriesByName(mark).length) {
performance.mark(mark);
}
measures.forEach(measure => {
performance.measure(measure.name, measure.start, measure.end);
});
});
};
|