- else if (token == "infinite") limits.infinite = true;
- else if (token == "ponder") limits.ponder = true;
+ else if (token == "perft") is >> limits.perft;
+ else if (token == "infinite") limits.infinite = 1;
+ else if (token == "ponder") ponderMode = true;
+
+ Threads.start_thinking(pos, states, limits, ponderMode);
+ }
+
+
+ // bench() is called when engine receives the "bench" command. Firstly
+ // a list of UCI commands is setup according to bench parameters, then
+ // it is run one by one printing a summary at the end.
+
+ void bench(Position& pos, istream& args, StateListPtr& states) {
+
+ string token;
+ uint64_t num, nodes = 0, cnt = 1;
+
+ vector<string> list = setup_bench(pos, args);
+ num = count_if(list.begin(), list.end(), [](string s) { return s.find("go ") == 0; });
+
+ TimePoint elapsed = now();