From afef55681ae8142aa050c8dac24b085cf4134423 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 16 Jan 2025 11:14:16 -0800 Subject: [PATCH] Validate test run after computing work instead of during timer. --- test.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test.html b/test.html index bc26e0a..587e004 100644 --- a/test.html +++ b/test.html @@ -93,16 +93,15 @@ SPDX-License-Identifier: GPL-3.0-or-later for (let i = 0; i < size; i++) { const hash = random() let work = null - let isValid = null const start = performance.now() try { work = await NanoPow.search(hash, { effort, debug }) - isValid = (await NanoPow.validate(work, hash)) ? 'VALID' : 'INVALID' } 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' times.push(end - start) const msg = `${isValid} [${work}] ${hash} (${end - start} ms)` // console.log(msg) -- 2.34.1