]> zoso.dev Git - nano-pow.git/commitdiff
Tweak status outputs when testing.
authorChris Duncan <chris@zoso.dev>
Fri, 17 Jan 2025 18:37:28 +0000 (10:37 -0800)
committerChris Duncan <chris@zoso.dev>
Fri, 17 Jan 2025 18:37:28 +0000 (10:37 -0800)
test.html

index d348c2db93dd5f4407d1d77a601c3f00e52b35ea..e076275569ce5a6371b3ddff83bd81351df07867 100644 (file)
--- a/test.html
+++ b/test.html
@@ -67,7 +67,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
 
                export async function run (size, effort, isOutputShown, isGlForced, isDebug) {
                        if (isGlForced) NanoPow = NanoPowGl
-                       document.getElementById('status').innerHTML = `TESTING IN PROGRESS`
+                       document.getElementById('status').innerHTML = `TESTING IN PROGRESS 0/${size}`
                        console.log(`%cNanoPow`, 'color:green', 'Checking validate()')
                        const expectFalse = await NanoPow.validate('0000000000000000', '0000000000000000000000000000000000000000000000000000000000000000')
                        console.log(`validate() output for bad nonce is ${expectFalse === false ? 'correct' : 'incorrect'}`)
@@ -91,6 +91,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
                        const times = []
                        document.getElementById('output').innerHTML += `Now testing: NanoPow (${type}) | Dispatch: ${(effort * 0x100) ** 2} | Threads/Dispatch: ${8 * 8 * ((effort * 0x100) ** 2)}<br/>`
                        for (let i = 0; i < size; i++) {
+                               document.getElementById('status').innerHTML = `TESTING IN PROGRESS ${i}/${size}<br/>`
                                const hash = random()
                                let work = null
                                const start = performance.now()
@@ -101,7 +102,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
                                        console.error(err)
                                }
                                const end = performance.now()
-                               document.getElementById('status').innerHTML = `TESTING IN PROGRESS ${i}/${size}<br/>`
                                const isValid = (await NanoPow.validate(work, hash)) ? 'VALID' : 'INVALID'
                                times.push(end - start)
                                const msg = `${isValid} [${work}] ${hash} (${end - start} ms)`
@@ -166,7 +166,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
        <label for="effort">Effort (1-16)</label>
        <input id="effort" type="number" value="8" min="1" max="16" />
        <label for="isOutputShown">Show output?</label>
-       <input id="isOutputShown" type="checkbox" />
+       <input id="isOutputShown" type="checkbox" checked />
        <label for="isGlForced">Force WebGL?</label>
        <input id="isGlForced" type="checkbox" />
        <label for="isDebug">Debug?</label>