]> git.codecow.com Git - nano-pow.git/commitdiff
Change logging on test page score function.
authorChris Duncan <chris@zoso.dev>
Mon, 16 Jun 2025 18:45:58 +0000 (11:45 -0700)
committerChris Duncan <chris@zoso.dev>
Mon, 16 Jun 2025 18:45:58 +0000 (11:45 -0700)
test/index.html

index ca0a5b71e14addaac462cc8b425cb4ef6726214d..f56d9f6b5e5728352bea08b07aaf7d547af089d1 100644 (file)
@@ -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}<br/>`
                                        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<br/>`
@@ -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)
                }