equal
deleted
inserted
replaced
82 * |
82 * |
83 * TIC() / TOC() creates it's own block, so make sure not the mangle |
83 * TIC() / TOC() creates it's own block, so make sure not the mangle |
84 * it with an other block. |
84 * it with an other block. |
85 **/ |
85 **/ |
86 #define TIC() {\ |
86 #define TIC() {\ |
87 extern uint64 _rdtsc();\ |
87 extern uint64 ottd_rdtsc();\ |
88 uint64 _xxx_ = _rdtsc();\ |
88 uint64 _xxx_ = ottd_rdtsc();\ |
89 static uint64 __sum__ = 0;\ |
89 static uint64 __sum__ = 0;\ |
90 static uint32 __i__ = 0; |
90 static uint32 __i__ = 0; |
91 |
91 |
92 #define TOC(str, count)\ |
92 #define TOC(str, count)\ |
93 __sum__ += _rdtsc() - _xxx_;\ |
93 __sum__ += ottd_rdtsc() - _xxx_;\ |
94 if (++__i__ == count) {\ |
94 if (++__i__ == count) {\ |
95 DEBUG(misc, 0, "[%s] %" OTTD_PRINTF64 "u [avg: %.1f]\n", str, __sum__, __sum__/(double)__i__);\ |
95 DEBUG(misc, 0, "[%s] %" OTTD_PRINTF64 "u [avg: %.1f]\n", str, __sum__, __sum__/(double)__i__);\ |
96 __i__ = 0;\ |
96 __i__ = 0;\ |
97 __sum__ = 0;\ |
97 __sum__ = 0;\ |
98 }\ |
98 }\ |