src/debug.h
branchNewGRF_ports
changeset 6720 35756db7e577
parent 6573 7624f942237f
child 6872 1c4a4a609f85
child 8627 448ebf3a8291
equal deleted inserted replaced
6719:4cc327ad39d5 6720:35756db7e577
    91 	#define OTTD_PRINTF64 "I64"
    91 	#define OTTD_PRINTF64 "I64"
    92 #else
    92 #else
    93 	#define OTTD_PRINTF64 "ll"
    93 	#define OTTD_PRINTF64 "ll"
    94 #endif
    94 #endif
    95 
    95 
    96 /* Used for profiling */
    96 /* Used for profiling
       
    97  *
       
    98  * Usage:
       
    99  * TIC();
       
   100  *   --Do your code--
       
   101  * TOC("A name", 1);
       
   102  *
       
   103  * When you run the TIC() / TOC() multiple times, you can increase the '1'
       
   104  *  to only display average stats every N values. Some things to know:
       
   105  *
       
   106  * for (int i = 0; i < 5; i++) {
       
   107  *   TIC();
       
   108  *     --Do yuor code--
       
   109  *   TOC("A name", 5);
       
   110  * }
       
   111  *
       
   112  * Is the correct usage for multiple TIC() / TOC() calls.
       
   113  *
       
   114  * TIC() / TOC() creates it's own block, so make sure not the mangle
       
   115  *  it with an other block.
       
   116  **/
    97 #define TIC() {\
   117 #define TIC() {\
    98 	extern uint64 _rdtsc();\
   118 	extern uint64 _rdtsc();\
    99 	uint64 _xxx_ = _rdtsc();\
   119 	uint64 _xxx_ = _rdtsc();\
   100 	static uint64 __sum__ = 0;\
   120 	static uint64 __sum__ = 0;\
   101 	static uint32 __i__ = 0;
   121 	static uint32 __i__ = 0;