mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-16 15:16:25 +08:00
Guard against 'divide by zero' in bench
Also remove an useless cast. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -132,10 +132,10 @@ void benchmark(const Position& current, istream& is) {
|
||||
}
|
||||
}
|
||||
|
||||
int e = time.elapsed();
|
||||
int e = time.elapsed() + 1; // Assure positive to avoid a 'divide by zero'
|
||||
|
||||
cerr << "\n==========================="
|
||||
<< "\nTotal time (ms) : " << e
|
||||
<< "\nNodes searched : " << nodes
|
||||
<< "\nNodes/second : " << int(nodes / (e / 1000.0)) << endl;
|
||||
<< "\nNodes/second : " << 1000 * nodes / e << endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user