From 7ba56300d7d6629a1b4d679576fa934c01b743dc Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Wed, 24 Apr 2024 17:40:55 +0300 Subject: [PATCH] benchmarks --- benchmarks/ark_prover_bench.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/benchmarks/ark_prover_bench.nim b/benchmarks/ark_prover_bench.nim index 379d59b2..6adb6d81 100644 --- a/benchmarks/ark_prover_bench.nim +++ b/benchmarks/ark_prover_bench.nim @@ -30,13 +30,15 @@ import codex/slots/backends/helpers import create_circuits template benchmark(benchmarkName: string, blk: untyped) = + var ts = 0.0 for i in 1..3: block: let t0 = epochTime() `blk` let elapsed = epochTime() - t0 - let elapsedStr = elapsed.formatFloat(format = ffDecimal, precision = 3) - echo "CPU Time [", benchmarkName, "] ", elapsedStr, "s" + ts = elapsed / i.toFloat + let elapsedStr = ts.formatFloat(format = ffDecimal, precision = 3) + echo "CPU Time [", benchmarkName, "] ", elapsedStr, "s" proc setup( circuitDir: string, name: string,