From c4a6b37460331f61b24e6dc782078c7c307b4ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 13 Apr 2024 16:14:42 +0100 Subject: [PATCH] cid#360694 silence Division or modulo by float zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Caolán McNamara Change-Id: Ifac9d92f95e131f2888bef6a74435b3d6a8df829 --- tools/Benchmark.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/Benchmark.cpp b/tools/Benchmark.cpp index 20760062d8..dedd46e8bf 100644 --- a/tools/Benchmark.cpp +++ b/tools/Benchmark.cpp @@ -57,6 +57,8 @@ public: std::cout << "took: " << std::chrono::duration_cast(end - start).count() << "ms - "; + assert(deltas && "div by zero otherwise"); + std::cout << "time/rle: " << (1.0*std::chrono::duration_cast(end - start).count())/deltas << "us\n"; }