Move frame measurement code into shared location

Change-Id: Ib083773a9f9efbe337daa05146ef85259c0fdc35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300174
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/tools/perf-canvaskit-puppeteer/perf-canvaskit-with-puppeteer.js b/tools/perf-canvaskit-puppeteer/perf-canvaskit-with-puppeteer.js
index 402f4c1..a55c25b 100644
--- a/tools/perf-canvaskit-puppeteer/perf-canvaskit-with-puppeteer.js
+++ b/tools/perf-canvaskit-puppeteer/perf-canvaskit-with-puppeteer.js
@@ -127,9 +127,12 @@
   console.log(commandLineUsage(usage));
   process.exit(1);
 }
+
+const benchmarkJS = fs.readFileSync('benchmark.js', 'utf8');
 const canvasKitJS = fs.readFileSync(options.canvaskit_js, 'utf8');
 const canvasKitWASM = fs.readFileSync(options.canvaskit_wasm, 'binary');
 
+app.get('/static/benchmark.js', (req, res) => res.send(benchmarkJS));
 app.get('/static/canvaskit.js', (req, res) => res.send(canvasKitJS));
 app.get('/static/canvaskit.wasm', function(req, res) {
   // Set the MIME type so it can be streamed efficiently.