Welcome to mirror list, hosted at ThFree Co, Russian Federation.

utils.js « performance « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0001ef54244ac5ed3160c7925082972001d18f74 (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);
    });
  });
};