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: 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);
    });
  });
};