mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 19:16:49 +08:00
Refactor elapsed time checks in search
Small improvement of the elapsed time usage in search, makes the code easier to read overall. Also Search::Worker::iterative_deepening() now only checks the elapsed time once, instead of 3 times in a row. Non Regression STC: https://tests.stockfishchess.org/tests/view/6617005d5a4693796d965c3c LLR: 2.97 (-2.94,2.94) <-1.75,0.25> Total: 61024 W: 16002 L: 15806 D: 29216 Ptnml(0-2): 243, 6874, 16102, 7030, 263 closes https://github.com/official-stockfish/Stockfish/pull/5163 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
432995ad82
commit
d3fc1d835e
@@ -30,9 +30,6 @@ namespace Stockfish {
|
||||
|
||||
TimePoint TimeManagement::optimum() const { return optimumTime; }
|
||||
TimePoint TimeManagement::maximum() const { return maximumTime; }
|
||||
TimePoint TimeManagement::elapsed(size_t nodes) const {
|
||||
return useNodesTime ? TimePoint(nodes) : now() - startTime;
|
||||
}
|
||||
|
||||
void TimeManagement::clear() {
|
||||
availableNodes = 0; // When in 'nodes as time' mode
|
||||
|
||||
Reference in New Issue
Block a user