X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbenchmark.cpp;h=f58d82e2cdf3df840906aee516c2ca72d95b89ce;hp=cf0a315c1090a95236029977e845ca5d6d4c1199;hb=087b638f6c8982927cbff0d44d6fb825a567e182;hpb=60c121f3b1ee7d5ced3435cc1718e4e6e6fd8383 diff --git a/src/benchmark.cpp b/src/benchmark.cpp index cf0a315c..f58d82e2 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -104,7 +104,7 @@ void benchmark(const Position& current, istream& is) { Options["Hash"] = ttSize; Options["Threads"] = threads; - TT.clear(); + Search::reset(); if (limitType == "time") limits.movetime = stoi(limit); // movetime is in ms @@ -143,8 +143,7 @@ void benchmark(const Position& current, istream& is) { } uint64_t nodes = 0; - Search::StateStackPtr st; - Time::point elapsed = Time::now(); + TimePoint elapsed = now(); for (size_t i = 0; i < fens.size(); ++i) { @@ -157,13 +156,14 @@ void benchmark(const Position& current, istream& is) { else { + Search::StateStackPtr st; Threads.start_thinking(pos, limits, st); - Threads.wait_for_think_finished(); + Threads.main()->join(); nodes += Search::RootPos.nodes_searched(); } } - elapsed = Time::now() - elapsed + 1; // Ensure positivity to avoid a 'divide by zero' + elapsed = now() - elapsed + 1; // Ensure positivity to avoid a 'divide by zero' dbg_print(); // Just before to exit