#include <fstream>
#include <iostream>
-#include <set>
#include <vector>
#include "misc.h"
#include "ucioption.h"
using namespace std;
-using namespace Search;
static const char* Defaults[] = {
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
void benchmark(int argc, char* argv[]) {
vector<string> fens;
- LimitsType limits;
- int time;
+ Search::LimitsType limits;
int64_t nodes = 0;
// Assign default values to missing arguments
else
fens.assign(Defaults, Defaults + 16);
- time = system_time();
+ Time time = Time::current_time();
for (size_t i = 0; i < fens.size(); i++)
{
if (valType == "perft")
{
- int64_t cnt = perft(pos, limits.maxDepth * ONE_PLY);
+ int64_t cnt = Search::perft(pos, limits.maxDepth * ONE_PLY);
cerr << "\nPerft " << limits.maxDepth << " leaf nodes: " << cnt << endl;
nodes += cnt;
}
else
{
- Threads.start_thinking(pos, limits, set<Move>(), false);
- nodes += RootPosition.nodes_searched();
+ Threads.start_thinking(pos, limits);
+ nodes += Search::RootPosition.nodes_searched();
}
}
- time = system_time() - time;
+ int e = time.elapsed();
cerr << "\n==========================="
- << "\nTotal time (ms) : " << time
+ << "\nTotal time (ms) : " << e
<< "\nNodes searched : " << nodes
- << "\nNodes/second : " << int(nodes / (time / 1000.0)) << endl;
+ << "\nNodes/second : " << int(nodes / (e / 1000.0)) << endl;
}