fix: truncate pow compute time before submitting

This commit is contained in:
Aravinth Manivannan
2023-07-02 20:00:25 +05:30
parent 3e5936cb83
commit 1b05cdc391
3 changed files with 2 additions and 9 deletions

View File

@@ -19,15 +19,9 @@ onmessage = async (e) => {
console.debug("message received at worker");
const config: PoWConfig = e.data;
const t0 = performance.now();
const work = await prove(config);
const t1 = performance.now();
const duration = t1 - t0;
const res: ServiceWorkerWork = {
work,
duration,
};
postMessage(res);