From: Chris Duncan Date: Mon, 16 Jun 2025 18:45:58 +0000 (-0700) Subject: Change logging on test page score function. X-Git-Tag: v5.0.0~12 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=7677e470cf805b7228ef0942f2646cbc8fe9c03b;p=nano-pow.git Change logging on test page score function. --- diff --git a/test/index.html b/test/index.html index ca0a5b7..f56d9f6 100644 --- a/test/index.html +++ b/test/index.html @@ -178,10 +178,10 @@ SPDX-License-Identifier: GPL-3.0-or-later } export async function score (runs, size, difficulty, effort, api) { + console.log(`%cNanoPow ${api}`, 'color:green', `Calculate truncated harmonic mean of the truncated arithmetic rate across ${runs} runs of ${size} samples.`) const rates = [] for (let i = 0; i < runs; i++) { const times = [] - console.log(`%cNanoPow ${api}`, 'color:green', `Calculate proof-of-work for ${runs} unique send block hashes`) for (let j = 0; j < size; j++) { document.getElementById('status').innerHTML = `SCORING IN PROGRESS. THIS WILL TAKE A LONG TIME. ${i}/${size} ${j}/${runs}
` const hash = random() @@ -197,8 +197,6 @@ SPDX-License-Identifier: GPL-3.0-or-later times.push(performance.now() - start) } const results = Object.values(average(times))[0] - console.log(times) - console.log(results) const { truncatedRate } = results rates.push(truncatedRate) document.getElementById('output').innerHTML += `Benchmark ${i + 1} score: ${truncatedRate} wps
` @@ -269,7 +267,7 @@ SPDX-License-Identifier: GPL-3.0-or-later const effort = document.getElementById('effort') const api = document.getElementById('api') const isOutputShown = document.getElementById('isOutputShown') - score(+runs.value, +size.value, difficulty.value, +effort.value, api.value, isOutputShown.checked) + score(+runs.value, +size.value, difficulty.value, +effort.value, api.value) .then(() => event.target.disabled = false) }