- int64_t perftCnt = perft(pos, maxDepth * ONE_PLY);
- cerr << "\nPerft " << maxDepth << " result (nodes searched): " << perftCnt << endl << endl;
- totalNodes += perftCnt;
- } else {
- if (!think(pos, false, false, dummy, dummy, 0, maxDepth, maxNodes, secsPerPos, moves))
- break;
- totalNodes += pos.nodes_searched();
+ int64_t cnt = Search::perft(pos, limits.maxDepth * ONE_PLY);
+
+ cerr << "\nPerft " << limits.maxDepth
+ << " nodes counted: " << cnt << endl;
+
+ totalNodes += cnt;
+ }
+ else
+ {
+ Threads.start_thinking(pos, limits, searchMoves, false);
+ totalNodes += Search::RootPosition.nodes_searched();