commit 807de4e2616ad5e9056c461cee00a220ef178b4a
Author:     Laslo Hunhold <[email protected]>
AuthorDate: Sat Jan 8 16:50:45 2022 +0100
Commit:     Laslo Hunhold <[email protected]>
CommitDate: Sat Jan 8 16:50:45 2022 +0100

    benchmark/util.c: Explicitly convert to double
    
    Signed-off-by: Laslo Hunhold <[email protected]>

diff --git a/benchmark/util.c b/benchmark/util.c
index b1f74e1..71a5fe7 100644
--- a/benchmark/util.c
+++ b/benchmark/util.c
@@ -59,7 +59,8 @@ run_benchmark(void (*func)(const void *), const void *payload,
                }
        }
        clock_gettime(CLOCK_MONOTONIC, &end);
-       diff = time_diff(&start, &end) / num_iterations / units_per_iteration;
+       diff = time_diff(&start, &end) / (double)num_iterations /
+              (double)units_per_iteration;
 
        if (isnan(*baseline)) {
                *baseline = diff;

Reply via email to