From: Chris Duncan Date: Sat, 11 Jan 2025 05:37:29 +0000 (-0800) Subject: Try to log WebGPU errors to catch iOS timing out. X-Git-Tag: v0.0.1~7 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=29467bda80350fd850ce9fe76f0e736b5148c698;p=nano-pow.git Try to log WebGPU errors to catch iOS timing out. --- 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 = []