From 29467bda80350fd850ce9fe76f0e736b5148c698 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 10 Jan 2025 21:37:29 -0800 Subject: [PATCH] Try to log WebGPU errors to catch iOS timing out. --- test.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test.html b/test.html index c2a622a..0536fe9 100644 --- a/test.html +++ b/test.html @@ -22,8 +22,13 @@ SPDX-License-Identifier: GPL-3.0-or-later times = [] for (let i = 0; i < COUNT; i++) { const hash = random() + let work = null const start = performance.now() - const work = await NanoPowGpu.search(hash) + try { + work = await NanoPowGpu.search(hash) + } catch (err) { + document.getElementById('output').innerHTML += `${err.message}
` + } const end = performance.now() times.push(end - start) const msg = `[${work}] ${hash} (${end - start} ms)` @@ -50,7 +55,7 @@ SPDX-License-Identifier: GPL-3.0-or-later document.getElementById('summary').innerHTML += `NanoPowGl
${JSON.stringify(average(times), null, '\t')}
` print(times) - console.log(`%nano-webgl-pow `, 'color:green', `Calculate proof-of-work for ${COUNT} unique send block hashes`) + console.log(`%cnano-webgl-pow `, 'color:green', `Calculate proof-of-work for ${COUNT} unique send block hashes`) window.NanoWebglPow.width = 256 * Math.max(1, Math.floor(navigator.hardwareConcurrency)) window.NanoWebglPow.height = 256 * Math.max(1, Math.floor(navigator.hardwareConcurrency)) times = [] -- 2.34.1