summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/benchmark.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/benchmark.h b/src/benchmark.h
index e13d9a3850..a59e088e29 100644
--- a/src/benchmark.h
+++ b/src/benchmark.h
@@ -62,6 +62,5 @@ double stop_benchmark(struct benchmark_st *st, const char *metric,
inline static unsigned int
timespec_sub_ms(struct timespec *a, struct timespec *b)
{
- return (a->tv_sec * 1000 + a->tv_nsec / (1000 * 1000) -
- (b->tv_sec * 1000 + b->tv_nsec / (1000 * 1000)));
+ return (a->tv_sec - b->tv_sec) * 1000 + (a->tv_nsec - b->tv_nsec) / (1000 * 1000);
}