From 3417f2852cffd07654009f331587bcf7751170bd Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 19 Jan 2025 22:07:36 -0800 Subject: [PATCH] Eliminate redundant console print function. Pass threshold of zero for test comparison purposes. --- test.html | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/test.html b/test.html index 9699386..10dc52f 100644 --- a/test.html +++ b/test.html @@ -60,19 +60,6 @@ SPDX-License-Identifier: GPL-3.0-or-later } } - function print (times) { - const { arithmetic, count, geometric, harmonic, min, max, rate, total, truncated } = average(times) - console.log(`Count: ${count} nonces`) - console.log(`Total: ${total} ms`) - console.log(`Rate: ${rate} nonces/second`) - console.log(`Minimum: ${min} ms`) - console.log(`Maximum: ${max} ms`) - console.log(`Arithmetic Mean: ${arithmetic} ms`) - console.log(`Truncated Mean: ${truncated} ms`) - console.log(`Harmonic Mean: ${harmonic} ms`) - console.log(`Geometric Mean: ${geometric} ms`) - } - export async function run (size, effort, isOutputShown, isGlForced, isDebug) { if (isGlForced) NanoPow = NanoPowGl document.getElementById('status').innerHTML = `TESTING IN PROGRESS 0/${size}` @@ -103,13 +90,13 @@ SPDX-License-Identifier: GPL-3.0-or-later let work = null const start = performance.now() try { - work = await NanoPow.search(hash, { effort, debug: isDebug }) + work = await NanoPow.search(hash, { threshold: 0, effort, debug: isDebug }) } catch (err) { document.getElementById('output').innerHTML += `Error: ${err.message}
` console.error(err) } const end = performance.now() - const isValid = (await NanoPow.validate(work, hash)) ? 'VALID' : 'INVALID' + const isValid = (await NanoPow.validate(work, hash, { threshold: 0 })) ? 'VALID' : 'INVALID' times.push(end - start) const msg = `${isValid} [${work}] ${hash} (${end - start} ms)` // console.log(msg) @@ -117,7 +104,6 @@ SPDX-License-Identifier: GPL-3.0-or-later } document.getElementById('output').innerHTML += `
` document.getElementById('summary').innerHTML += `${JSON.stringify(average(times, effort), null, '\t')}
` - print(times) document.getElementById('status').innerHTML = `TESTING COMPLETE
` console.log('%cTESTING COMPLETE', 'color:orange;font-weight:bold') } -- 2.34.1