From 0096ef6306c1539cff38cde38d6cd3ab993122d5 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Wed, 8 Jan 2025 14:37:04 -0800 Subject: [PATCH] Tweak layout of web page used for platform testing. --- index.html | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index dfd2c71..c8ffa10 100644 --- a/index.html +++ b/index.html @@ -22,21 +22,24 @@ await block.pow() const end = performance.now() times.push(end - start) - works.innerHTML += `libnemo-powgpu: ${block.work} (${end - start} ms)
` + works.innerHTML += `${block.work} (${end - start} ms)
` console.log(block.work) } - let sum = 0, reciprocals = 0, product = 1, count = times.length + let sum = 0, reciprocals = 0, logarithms = 0, count = times.length, min = 0xffff, max = 0 for (let i = 0; i < count; i++) { sum += times[i] reciprocals += 1 / times[i] - product *= times[i] + logarithms += Math.log(times[i]) + min = Math.min(min, times[i]) + max = Math.max(max, times[i]) } const t = document.getElementById('times') - t.innerHTML = `libnemo-powgpu
-Total: ${sum} ms
+ t.innerHTML = `Total: ${sum} ms
Average: ${sum / count} ms
Harmonic: ${count / reciprocals} ms
-Geometric: ${Math.pow(product, 1 / count)} ms
` +Geometric: ${Math.exp(logarithms / count)} ms
+Minimum: ${min} ms
+Maximum: ${max} ms
` })()