]> git.sesse.net Git - stockfish/blobdiff - src/benchmark.cpp
Explicitly use threads.size()
[stockfish] / src / benchmark.cpp
index b0b9e16b7881da1783326d72825a376998e99020..c3a4191337d69c4d8f91f637e2c3839b8857eb78 100644 (file)
@@ -120,7 +120,7 @@ void benchmark(const Position& current, istream& is) {
 
       if (limitType == "perft")
       {
-          int64_t cnt = Search::perft(pos, limits.depth * ONE_PLY);
+          size_t cnt = Search::perft(pos, limits.depth * ONE_PLY);
           cerr << "\nPerft " << limits.depth  << " leaf nodes: " << cnt << endl;
           nodes += cnt;
       }
@@ -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;
 }