debian-mirror-gitlab/app/assets/javascripts/performance/utils.js

11 lines
336 B
JavaScript
Raw Normal View History

2021-01-03 14:25:43 +05:30
export const performanceMarkAndMeasure = ({ mark, measures = [] } = {}) => {
window.requestAnimationFrame(() => {
if (mark && !performance.getEntriesByName(mark).length) {
performance.mark(mark);
}
2021-03-08 18:12:59 +05:30
measures.forEach((measure) => {
2021-01-03 14:25:43 +05:30
performance.measure(measure.name, measure.start, measure.end);
});
});
};