chromium/third_party/blink/web_tests/fast/harness/perftests/measure-frame-time.html

<script src="../../../../../blink/perf_tests/resources/runner.js"></script>
<script>
// Suppress JavaScript trace event console messages.
console.time = function() {};
console.timeEnd = function() {};

// The initial value doesn't affect result.
var virtualTime = 123456;
PerfTestRunner.now = function () { return virtualTime; }

var originalRequestAnimationFrame = window.requestAnimationFrame;
window.requestAnimationFrame = function(f) {
  // This time is part of the result.
  virtualTime += 10;
  originalRequestAnimationFrame(f);
};

PerfTestRunner.measureFrameTime({
  run: function () {
    // This time is part of the result.
    virtualTime += 20;
  },
  warmUpCount: 3,
  iterationCount: 5,
  doNotMeasureMemoryUsage: true,
});
</script>