X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmisc.cpp;h=68f6103c651b0d467072edcd15812939fead7f44;hp=8691c3802aedcddf3b8cc7ac56fa6d40398d467f;hb=a9e55d43262d11a916bdfa68cd1de0174d884cd3;hpb=5f8f83bc0510039529040e7e877fa66fcb28005e diff --git a/src/misc.cpp b/src/misc.cpp index 8691c380..68f6103c 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -37,6 +37,7 @@ int gettimeofday(struct timeval * tp, struct timezone * tzp); #endif +#include #include #include #include @@ -63,6 +64,43 @@ bool dbg_show_hit_rate = false; //// Functions //// +void dbg_hit_on(bool b) { + + assert(!dbg_show_mean); + dbg_show_hit_rate = true; + dbg_cnt0++; + if (b) + dbg_cnt1++; +} + +void dbg_hit_on_c(bool c, bool b) { + + if (c) + dbg_hit_on(b); +} + +void dbg_before() { + + assert(!dbg_show_mean); + dbg_show_hit_rate = true; + dbg_cnt0++; +} + +void dbg_after() { + + assert(!dbg_show_mean); + dbg_show_hit_rate = true; + dbg_cnt1++; +} + +void dbg_mean_of(int v) { + + assert(!dbg_show_hit_rate); + dbg_show_mean = true; + dbg_cnt0++; + dbg_cnt1 += v; +} + void dbg_print_hit_rate() { std::cout << "Total " << dbg_cnt0 << " Hit " << dbg_cnt1