--- /dev/null
+SEND BLOCK
+
+start calculate: 155 c88dd903-db2a-4aa6-b394-f60167006006:1497:17
+color cleared: 230 c88dd903-db2a-4aa6-b394-f60167006006:1511:17
+starting first draw: 234 c88dd903-db2a-4aa6-b394-f60167006006:1782:17
+start readPixels: 264 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 305 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 308 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 348 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 351 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 394 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 402 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 444 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 446 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 485 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 488 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 525 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 528 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 568 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 571 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 609 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 612 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 650 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 656 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 695 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 698 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 736 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 738 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 778 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 781 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 819 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 821 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 858 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+start readPixels: 861 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 900 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+found: 903 c88dd903-db2a-4aa6-b394-f60167006006:1770:23
+
+Total: 900 ms block.perf.js:32:10
+Average: 900 ms block.perf.js:33:10
+Harmonic: 900 ms block.perf.js:34:10
+Geometric: 900 ms block.perf.js:35:10
+
+
+
+RECEIVE BLOCK
+
+start calculate: 905 c88dd903-db2a-4aa6-b394-f60167006006:1497:17
+color cleared: 960 c88dd903-db2a-4aa6-b394-f60167006006:1511:17
+starting first draw: 963 c88dd903-db2a-4aa6-b394-f60167006006:1782:17
+start readPixels: 969 c88dd903-db2a-4aa6-b394-f60167006006:1765:19
+end readPixels: 1008 c88dd903-db2a-4aa6-b394-f60167006006:1767:19
+found: 1008 c88dd903-db2a-4aa6-b394-f60167006006:1770:23
+
+
+Total: 104 ms block.perf.js:56:10
+Average: 104 ms block.perf.js:57:10
+Harmonic: 104 ms block.perf.js:58:10
+Geometric: 104 ms block.perf.js:59:10
+
+PASS Time to calculate proof-of-work for a receive block 0x10 times GLOBALS.mjs:42:9
+TESTING COMPLETE main.mjs:8:8
+
+
}
static calculate (hashHex: string, threshold: number | string = '0xFFFFFFF8', callback: (nonce: string | PromiseLike<string>) => any): void {
+ console.log(`start calculate: ${performance.now()}`)
if (typeof threshold === 'number') threshold = '0x' + threshold.toString(16)
if (!/^[A-F-a-f0-9]{64}$/.test(hashHex)) throw new Error(`invalid_hash ${hashHex}`)
let reverseHex = ''
gl.clearColor(0, 0, 0, 1)
+ console.log(`color cleared: ${performance.now()}`)
// Vertext Shader
const vsSource = `#version 300 es
gl.clear(gl.COLOR_BUFFER_BIT)
gl.drawArrays(gl.TRIANGLES, 0, 6)
const pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4)
+
+ console.log(`start readPixels: ${performance.now()}`)
gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels)
+ console.log(`end readPixels: ${performance.now()}`)
// Check the pixels for any success
for (let i = 0; i < pixels.length; i += 4) {
if (pixels[i] !== 0) {
+ console.log(`found: ${performance.now()}`)
// Return the work value with the custom bits
typeof callback === 'function' &&
callback(this.hexify(work1) + this.hexify([
self.requestAnimationFrame(draw)
}
+ console.log(`starting first draw: ${performance.now()}`)
// Begin generation
self.requestAnimationFrame(draw)
}