]> zoso.dev Git - nano-pow.git/commitdiff
Tweak timing output and add some context for the viewer.
authorChris Duncan <chris@zoso.dev>
Sat, 11 Jan 2025 07:21:07 +0000 (23:21 -0800)
committerChris Duncan <chris@zoso.dev>
Sat, 11 Jan 2025 07:21:07 +0000 (23:21 -0800)
test.html

index 2849d5cea47cd25b441200a7643ed87c043c9484..9d3b3c66187592e8338a6bfd29146c75a950085b 100644 (file)
--- a/test.html
+++ b/test.html
@@ -35,25 +35,27 @@ SPDX-License-Identifier: GPL-3.0-or-later
                                if (i > (count * 0.1) && i < (count * 0.9)) truncated += times[i]
                        }
                        return {
+                               count: count,
                                total: sum,
+                               min: min,
+                               max: max,
                                arithmetic: sum / count,
-                               harmonic: count / reciprocals,
-                               geometric: Math.exp(logarithms / count),
                                truncated: truncated / count,
-                               min: min,
-                               max: max
+                               harmonic: count / reciprocals,
+                               geometric: Math.exp(logarithms / count)
                        }
                }
 
                function print (times) {
-                       const { arithmetic, geometric, harmonic, min, max, total, truncated } = average(times)
+                       const { arithmetic, count, geometric, harmonic, min, max, total, truncated } = average(times)
+                       console.log(`Count: ${count} ms`)
                        console.log(`Total: ${total} ms`)
-                       console.log(`Average: ${arithmetic} ms`)
-                       console.log(`Harmonic: ${harmonic} ms`)
-                       console.log(`Geometric: ${geometric} ms`)
-                       console.log(`Truncated: ${truncated} ms`)
                        console.log(`Minimum: ${min} ms`)
                        console.log(`Maximum: ${max} ms`)
+                       console.log(`Arithmetic Mean: ${arithmetic} ms`)
+                       console.log(`Truncated Mean: ${truncated} ms`)
+                       console.log(`Harmonic Mean: ${harmonic} ms`)
+                       console.log(`Geometric Mean: ${geometric} ms`)
                }
 
 
@@ -125,6 +127,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
        <p>NanoPowGpu uses cutting edge WebGPU technology. Not all browsers are supported.</p>
        <p>NanoPowGl uses WebGL 2.0 and is a fallback option in the NanoPow package.</p>
        <p>nano-webgl-pow is the original package from which NanoPow was inspired and optimized.</p>
+       <p>Times below are in milliseconds and summarized by various averaging methods.</p>
        <hr/>
        <pre id="summary"></pre>
        <hr/>