X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbenchmark.cpp;h=9f0ac0c145b220798eaab1449e8b848f3c411b94;hp=b43f0ee527392af234c9490e96ca2e560a3d40a5;hb=3aa471f2a9cb1cccd37c27906dd386b9724e32ab;hpb=93e539d909f20fe524e8272de3dff206257d8c1e diff --git a/src/benchmark.cpp b/src/benchmark.cpp index b43f0ee5..9f0ac0c1 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -28,7 +28,6 @@ #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", @@ -61,8 +60,7 @@ static const char* Defaults[] = { void benchmark(int argc, char* argv[]) { vector fens; - LimitsType limits; - int time; + Search::LimitsType limits; int64_t nodes = 0; // Assign default values to missing arguments @@ -74,7 +72,6 @@ void benchmark(int argc, char* argv[]) { Options["Hash"] = ttSize; Options["Threads"] = threads; - Options["OwnBook"] = false; if (valType == "time") limits.maxTime = 1000 * atoi(valStr.c_str()); // maxTime is in ms @@ -105,7 +102,7 @@ void benchmark(int argc, char* argv[]) { else fens.assign(Defaults, Defaults + 16); - time = system_time(); + Time time = Time::current_time(); for (size_t i = 0; i < fens.size(); i++) { @@ -115,21 +112,21 @@ void benchmark(int argc, char* argv[]) { 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, vector(), false); - nodes += RootPosition.nodes_searched(); + Threads.start_searching(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; }