]> git.sesse.net Git - stockfish/blobdiff - src/benchmark.cpp
Introduce and use wait_for_search_finished()
[stockfish] / src / benchmark.cpp
index ba05ac7fb8af7561bfd425e8dc1f4cdcfe738f16..9f0ac0c145b220798eaab1449e8b848f3c411b94 100644 (file)
@@ -61,7 +61,6 @@ void benchmark(int argc, char* argv[]) {
 
   vector<string> fens;
   Search::LimitsType limits;
-  int time;
   int64_t nodes = 0;
 
   // Assign default values to missing arguments
@@ -73,7 +72,6 @@ void benchmark(int argc, char* argv[]) {
 
   Options["Hash"]    = ttSize;
   Options["Threads"] = threads;
-  Options["OwnBook"] = false;
 
   if (valType == "time")
       limits.maxTime = 1000 * atoi(valStr.c_str()); // maxTime is in ms
@@ -104,7 +102,7 @@ void benchmark(int argc, char* argv[]) {
   else
       fens.assign(Defaults, Defaults + 16);
 
-  time = system_time();
+  Time time = Time::current_time();
 
   for (size_t i = 0; i < fens.size(); i++)
   {
@@ -120,15 +118,15 @@ void benchmark(int argc, char* argv[]) {
       }
       else
       {
-          Threads.start_thinking(pos, limits);
+          Threads.start_searching(pos, limits);
           nodes += Search::RootPosition.nodes_searched();
       }
   }
 
-  time = system_time() - time;
+  int e = time.elapsed();
 
   cerr << "\n==========================="
-       << "\nTotal time (ms) : " << time
+       << "\nTotal time (ms) : " << e
        << "\nNodes searched  : " << nodes
-       << "\nNodes/second    : " << int(nodes / (time / 1000.0)) << endl;
+       << "\nNodes/second    : " << int(nodes / (e / 1000.0)) << endl;
 }