+
+ vector<string>::iterator it;
+ int cnt = 1;
+ int64_t totalNodes = 0;
+ int startTime = get_system_time();
+
+ for (it = positions.begin(); it != positions.end(); ++it, ++cnt)
+ {
+ Move moves[1] = {MOVE_NONE};
+ int dummy[2] = {0, 0};
+ Position pos(*it);
+ cerr << "\nBench position: " << cnt << '/' << positions.size() << endl << endl;
+ if (limitType == "perft")
+ totalNodes += perft(pos, maxDepth * OnePly);
+ else if (!think(pos, false, false, 0, dummy, dummy, 0, maxDepth, maxNodes, secsPerPos, moves))
+ break;
+ totalNodes += nodes_searched();
+ }
+
+ cnt = get_system_time() - startTime;
+ cerr << "==============================="
+ << "\nTotal time (ms) : " << cnt
+ << "\nNodes searched : " << totalNodes
+ << "\nNodes/second : " << (int)(totalNodes/(cnt/1000.0)) << endl << endl;
+
+ if (!timFile.empty())
+ {
+ timingFile << cnt << endl << endl;
+ timingFile.close();
+ }
+
+ // 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))
+ cerr << "Press any key to exit" << endl;
+ cin >> fileName;
+ #endif