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'}`)
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()
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)`
<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>