equal
deleted
inserted
replaced
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; |