mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00: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:
parent
b61ec33f22
commit
90ec4a403a
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue