diff --git a/packages/frontend/src/components/VDFtester.svelte b/packages/frontend/src/components/VDFtester.svelte index 308f6df..e6bca8a 100644 --- a/packages/frontend/src/components/VDFtester.svelte +++ b/packages/frontend/src/components/VDFtester.svelte @@ -137,6 +137,18 @@ // 开始第一个测试 worker.postMessage({ g, N, difficulty }); } + + function getAccumulatedTime() { + return benchmarkResults.reduce((acc, result) => acc + result.time, 0); + } + + function getAccumulatedDifficulty() { + return benchmarkResults.reduce((acc, result) => acc + Number(result.difficulty), 0); + } + + function getSpeed() { + return (getAccumulatedDifficulty() / getAccumulatedTime()) * 1000; + }
+ Summary: + {getAccumulatedDifficulty()} + calculations done in {getAccumulatedTime().toFixed(1)}ms, + speed: {getSpeed().toFixed(2)} op/s +