diff --git a/packages/frontend/src/components/VDFtester.svelte b/packages/frontend/src/components/VDFtester.svelte index 22d6869..eeead88 100644 --- a/packages/frontend/src/components/VDFtester.svelte +++ b/packages/frontend/src/components/VDFtester.svelte @@ -79,12 +79,12 @@ let currentDifficulty: bigint | null = null; let worker: Worker | null = null; let currentTestIndex = 0; - const difficulties = [BigInt(100000), BigInt(1000000)]; + const difficulties = [BigInt(100), BigInt(1000)]; const testCombinations: { N: bigint; difficulty: bigint }[] = []; // 创建需要测试的 N 和难度的组合 - N_ARRAY.forEach(n => { - difficulties.forEach(difficulty => { + N_ARRAY.forEach((n) => { + difficulties.forEach((difficulty) => { testCombinations.push({ N: n, difficulty }); }); }); @@ -139,35 +139,55 @@ } -
-

VDF Benchmark

+
+

VDF Benchmark

{#if !isBenchmarking} - {/if} {#if isBenchmarking} -

Benchmarking in progress... ({currentTestIndex + 1}/{testCombinations.length})

+

+ Benchmarking in progress... ({currentTestIndex + 1}/{testCombinations.length}) +

{#if currentN !== null && currentDifficulty !== null} -

N Bits: {currentN.toString(2).length}

-

Difficulty: {currentDifficulty}

+

N Bits: {currentN.toString(2).length}

+

Difficulty: {currentDifficulty}

-
-
+
{/if} {/if} {#if benchmarkResults.length > 0 && !isBenchmarking} -

Benchmark Results

- +

Benchmark Results

+ + + + + + + + + + {#each benchmarkResults as result} + + + + + + {/each} + +
Time (ms)N (bits)T (log10)
{result.time.toFixed(2)}{result.N.toString(2).length}{Math.log10(Number(result.difficulty))}
{/if} -
\ No newline at end of file +