mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Add simple debug hit rate counter
Add a very simple debug framework to measure the hit rate of a given condition. Simply insert macro dbg_hit_on(x); Anywhere you want to compute hit rate of condition x and then call, as example in poll(), function dbg_print_hit_rate() to print current results. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -56,5 +56,13 @@ extern int get_system_time();
|
||||
extern int cpu_count();
|
||||
extern int Bioskey();
|
||||
|
||||
////
|
||||
//// Debug
|
||||
////
|
||||
extern long dbg_cnt0;
|
||||
extern long dbg_cnt1;
|
||||
extern void dbg_print_hit_rate();
|
||||
|
||||
#define dbg_hit_on(x) { dbg_cnt0++; if (x) dbg_cnt1++; }
|
||||
|
||||
#endif // !defined(MISC_H_INCLUDED)
|
||||
|
||||
Reference in New Issue
Block a user