X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fuci.cpp;h=69de2fb1fe4daa5bf43bbd1dc4136c05c6ebda22;hp=f6b27114b13d64f60fafbd24c74c9550b7053afe;hb=a530fc2b600da4e9247a0e0242dead246d824c68;hpb=7d0e0ff95eef8e38eb0b07f2e499d650e7680909 diff --git a/src/uci.cpp b/src/uci.cpp index f6b27114..69de2fb1 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -324,18 +324,17 @@ namespace { void perft(UCIInputParser& uip) { string token; - int depth = 0; + int depth, tm, n; + Position pos = RootPosition; - while (!uip.eof()) - { - uip >> token; + if (uip.eof()) + return; + + uip >> depth; + tm = get_system_time(); + + n = perft(pos, depth * OnePly); - if (token == "depth") - uip >> depth; - } - Position pos = RootPosition; - int tm = get_system_time(); - int n = perft(pos, depth * OnePly); tm = get_system_time() - tm; std::cout << "\nNodes " << n << "\nTime (ms) " << tm