From 4c2241089d4650e55a143659fe8002a392a91320 Mon Sep 17 00:00:00 2001 From: Disservin Date: Tue, 14 Jan 2025 08:34:37 +0100 Subject: [PATCH] Remove addition of 1ms to all timestamps The +1 was a quick fix to avoid the division by zero, a more correct approach is to use 1ms as the minimum reported timestamp to avoid a division by zero. Later timestamps no longer include an additional 1ms. closes https://github.com/official-stockfish/Stockfish/pull/5778 No functional change --- src/search.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index 3776e84b..66c5ff43 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -2117,7 +2117,7 @@ void SearchManager::pv(Search::Worker& worker, if (!isExact) info.bound = bound; - TimePoint time = tm.elapsed_time() + 1; + TimePoint time = std::max(TimePoint(1), tm.elapsed_time()); info.timeMs = time; info.nodes = nodes; info.nps = nodes * 1000 / time;