tl;dr: This is how you correctly measure performance after style, layout, and paint operations.

requestAnimationFrame(() => {
  setTimeout(() => {
    performance.mark("end");
  }, 0);
});