From: Chris Duncan Date: Thu, 13 Mar 2025 16:54:05 +0000 (-0700) Subject: Restore basic performance timing to CLI when debugging. X-Git-Tag: v3.1.0~2 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=fd7a014718c4b535e9b78214eb17c671a3669b73;p=nano-pow.git Restore basic performance timing to CLI when debugging. --- 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: `