]> git.sesse.net Git - stockfish/commitdiff
Only on Windows do wait for input at the end of benchmark
authorMarco Costalba <mcostalba@gmail.com>
Sat, 20 Jun 2009 06:58:05 +0000 (07:58 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 20 Jun 2009 08:04:20 +0000 (09:04 +0100)
Under MS Visual C++ debug window always unconditionally closes
when program exits, this is bad because we want to read results before.

So limit this kludge on Windows only.

Original patch by Heinz van Saanen.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/benchmark.cpp

index 02037689df0b770b7c07a0d1b347c0de11f362d4..590299d91439b981974fcd8c19647f909ae85072 100644 (file)
@@ -144,7 +144,16 @@ void benchmark(const string& commandLine) {
           break;
       totalNodes += nodes_searched();
   }
-  cout << "\nProcessing time (ms) " << get_system_time() - startTime
-       << "\nNodes searched " << totalNodes << "\nPress any key to exit" << endl;
+  cnt = get_system_time() - startTime;
+  cout << "\nProcessing time (ms) " << cnt
+       << "\nNodes searched " << totalNodes
+       << "\nNodes/second " << (int)(totalNodes/(cnt/1000.0))
+       << endl;
+
+  // Under MS Visual C++ debug window always unconditionally closes
+  // when program exits, this is bad because we want to read results before.
+  #if (defined(WINDOWS) || defined(WIN32) || defined(WIN64))
+  cout << "Press any key to exit" << endl;
   cin >> fileName;
+  #endif
 }