File diff r12227:937c28c992ae → r12228:1660f6f159c9
src/debug.h
Show inline comments
 
@@ -68,22 +68,22 @@ const char *GetDebugString();
 
 * TIC() / TOC() creates it's own block, so make sure not the mangle
 
 *  it with an other block.
 
 **/
 
#define TIC() {\
 
	extern uint64 ottd_rdtsc();\
 
	uint64 _xxx_ = ottd_rdtsc();\
 
	static uint64 __sum__ = 0;\
 
	static uint32 __i__ = 0;
 

	
 
#define TOC(str, count)\
 
	__sum__ += ottd_rdtsc() - _xxx_;\
 
	if (++__i__ == count) {\
 
		DEBUG(misc, 0, "[%s] %" OTTD_PRINTF64 "u [avg: %.1f]\n", str, __sum__, __sum__/(double)__i__);\
 
		DEBUG(misc, 0, "[%s] " OTTD_PRINTF64 " [avg: %.1f]\n", str, __sum__, __sum__/(double)__i__);\
 
		__i__ = 0;\
 
		__sum__ = 0;\
 
	}\
 
}
 

	
 
void ShowInfo(const char *str);
 
void CDECL ShowInfoF(const char *str, ...) WARN_FORMAT(1, 2);
 

	
 
#endif /* DEBUG_H */