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`)
}
<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/>