[hackers] [libgrapheme] benchmark/util.c: Explicitly convert to double || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Sat, 8 Jan 2022 16:51:06 +0100 (CET)

commit 807de4e2616ad5e9056c461cee00a220ef178b4a
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Sat Jan 8 16:50:45 2022 +0100
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Sat Jan 8 16:50:45 2022 +0100

    benchmark/util.c: Explicitly convert to double
    
    Signed-off-by: Laslo Hunhold <dev_AT_frign.de>

diff --git a/benchmark/util.c b/benchmark/util.c
index b1f74e1..71a5fe7 100644
--- a/benchmark/util.c
+++ b/benchmark/util.c
_AT_@ -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;
Received on Sat Jan 08 2022 - 16:51:06 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 08 2022 - 17:00:33 CET