X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fbenchmark.cpp;h=4735729add884116f27a981bf7736e55b1d2eb75;hb=161c6b025e763d6bcc8339a614be312f2b173437;hp=b43f0ee527392af234c9490e96ca2e560a3d40a5;hpb=93e539d909f20fe524e8272de3dff206257d8c1e;p=stockfish diff --git a/src/benchmark.cpp b/src/benchmark.cpp index b43f0ee5..4735729a 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 @@ -105,7 +103,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 +113,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_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; }