From fd7a014718c4b535e9b78214eb17c671a3669b73 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 13 Mar 2025 09:54:05 -0700 Subject: [PATCH] Restore basic performance timing to CLI when debugging. --- cli.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli.js b/cli.js index d066556..ab7f664 100755 --- a/cli.js +++ b/cli.js @@ -97,10 +97,14 @@ if (options['debug']) console.log(`${fn} options`, JSON.stringify(options)) const page = await browser.newPage() await page.setBypassCSP(true) await page.goto('chrome://terms') + + let start = performance.now() page.on('console', async (msg) => { const output = msg.text().split(' ') if (output[0] === 'cli') { if (output[1] === 'exit') { + const end = performance.now() + if (options['debug']) console.log(end - start, 'ms total |', (end - start) / hashes.length, 'ms avg') process.exit() } else { console.log(output[1]) @@ -112,6 +116,7 @@ if (options['debug']) console.log(`${fn} options`, JSON.stringify(options)) await page.waitForFunction(async () => { return await navigator.gpu.requestAdapter() }) + start = performance.now() await page.addScriptTag({ type: 'module', content: ` -- 2.34.1