await block.pow()
const end = performance.now()
times.push(end - start)
- works.innerHTML += `libnemo-powgl: ${block.work} (${end - start} ms)<br/>`
+ works.innerHTML += `libnemo-powgpu: ${block.work} (${end - start} ms)<br/>`
console.log(block.work)
}
let sum = 0, reciprocals = 0, product = 1, count = times.length
})()
</script>
<script type="module">
- (async () => {
- const times = []
- const works = document.getElementById('works')
- for (let i = 0; i < 0x10; i++) {
- const start = performance.now()
- const work = await new Promise(resolve => {
- window.NanoWebglPow('92BA74A7D6DC7557F3EDA95ADC6341D51AC777A0A6FF0688A5C492AB2B2CB40D', resolve, undefined, '0xFFFFFFF8')
- })
- const end = performance.now()
- times.push(end - start)
- works.innerHTML += `nano-webgl-pow: ${work} (${end - start} ms)<br/>`
- }
- let sum = 0, reciprocals = 0, product = 1, count = times.length
- for (let i = 0; i < count; i++) {
- sum += times[i]
- reciprocals += 1 / times[i]
- product *= times[i]
- }
- const t = document.getElementById('times')
- t.innerHTML += `nano-webgl-pow<br/>
+ /*
+ (async () => {
+ const times = []
+ const works = document.getElementById('works')
+ for (let i = 0; i < 0x10; i++) {
+ const start = performance.now()
+ const work = await new Promise(resolve => {
+ window.NanoWebglPow('92BA74A7D6DC7557F3EDA95ADC6341D51AC777A0A6FF0688A5C492AB2B2CB40D', resolve, undefined, '0xFFFFFFF8')
+ })
+ const end = performance.now()
+ times.push(end - start)
+ works.innerHTML += `nano-webgl-pow: ${work} (${end - start} ms)<br/>`
+ }
+ let sum = 0, reciprocals = 0, product = 1, count = times.length
+ for (let i = 0; i < count; i++) {
+ sum += times[i]
+ reciprocals += 1 / times[i]
+ product *= times[i]
+ }
+ const t = document.getElementById('times')
+ t.innerHTML += `nano-webgl-pow<br/>
Total: ${sum} ms<br/>
Average: ${sum / count} ms<br/>
Harmonic: ${count / reciprocals} ms<br/>
Geometric: ${Math.pow(product, 1 / count)} ms<br/>`
- })()
-
+ })()
+ */
</script>
<style>body{background:black;color:white;}</style>
</head>