2020-09-29 20:09:53 -04:00
|
|
|
export const performanceMarkAndMeasure = ({ mark, measures = [] } = {}) => {
|
|
|
|
window.requestAnimationFrame(() => {
|
|
|
|
if (mark && !performance.getEntriesByName(mark).length) {
|
|
|
|
performance.mark(mark);
|
|
|
|
}
|
2020-12-23 16:10:24 -05:00
|
|
|
measures.forEach((measure) => {
|
2020-10-05 11:08:56 -04:00
|
|
|
performance.measure(measure.name, measure.start, measure.end);
|
2020-09-29 20:09:53 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|