diff --git a/common/bench.c b/common/bench.c index 0436f67..b179bf8 100644 --- a/common/bench.c +++ b/common/bench.c @@ -63,7 +63,11 @@ void reset_timer() { } static int nextN() { - unsigned long long n = 2*SEC/(ns/N + 1); + unsigned long long n = ns/N; + if (n == 0) + n = SEC; + else + n = SEC/n; if (n > N*100ULL) n = N*100ULL; else if (n <= N)