No need to div/multiply

This commit is contained in:
Thomas Lynch
2022-10-03 08:32:11 +11:00
parent fb69c46574
commit c61dd4caa2
2 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ const powFinished = new Promise((resolve, reject) => {
let finished = false; let finished = false;
const messageHandler = (e) => { const messageHandler = (e) => {
if (e.data.length === 1) { if (e.data.length === 1) {
const totalHashes = e.data[0]*workerThreads; //assumes all worker threads are same speed const totalHashes = e.data[0]; //assumes all worker threads are same speed
const elapsedSec = Math.floor((Date.now()-start)/1000); const elapsedSec = Math.floor((Date.now()-start)/1000);
const hps = Math.floor(totalHashes/elapsedSec); const hps = Math.floor(totalHashes/elapsedSec);
const requiredSec = Math.floor(eHashes/hps) * 1.5; //estimate 1.5x time const requiredSec = Math.floor(eHashes/hps) * 1.5; //estimate 1.5x time

View File

@ -6,7 +6,7 @@ onmessage = async function(e) {
let i = id; let i = id;
if (id === 0) { if (id === 0) {
setInterval(() => { setInterval(() => {
postMessage([i/threads]); postMessage([i]);
}, 500); }, 500);
} }
while(true) { while(true) {