- vector<string> positions;
- string ttSize, threads, valStr, posFile, valType;
- int val, secsPerPos, maxDepth, maxNodes;
-
- ttSize = argc > 2 ? argv[2] : "128";
- threads = argc > 3 ? argv[3] : "1";
- valStr = argc > 4 ? argv[4] : "12";
- posFile = argc > 5 ? argv[5] : "default";
- valType = argc > 6 ? argv[6] : "depth";
-
- Options["Hash"].set_value(ttSize);
- Options["Threads"].set_value(threads);
- Options["OwnBook"].set_value("false");
- Options["Use Search Log"].set_value("true");
- Options["Search Log Filename"].set_value("bench.txt");
-
- secsPerPos = maxDepth = maxNodes = 0;
- val = atoi(valStr.c_str());
-
- if (valType == "depth" || valType == "perft")
- maxDepth = val;
- else if (valType == "time")
- secsPerPos = val * 1000;
+ vector<string> fens;
+ Search::LimitsType limits;
+ int64_t nodes = 0;
+
+ // Assign default values to missing arguments
+ string ttSize = argc > 2 ? argv[2] : "128";
+ string threads = argc > 3 ? argv[3] : "1";
+ string valStr = argc > 4 ? argv[4] : "12";
+ string fenFile = argc > 5 ? argv[5] : "default";
+ string valType = argc > 6 ? argv[6] : "depth";
+
+ Options["Hash"] = ttSize;
+ Options["Threads"] = threads;
+
+ if (valType == "time")
+ limits.maxTime = 1000 * atoi(valStr.c_str()); // maxTime is in ms
+
+ else if (valType == "nodes")
+ limits.maxNodes = atoi(valStr.c_str());
+