static */
| 155 | } |
| 156 | |
| 157 | /* static */ uint32_t NewGRFProfiler::FinishAll() |
| 158 | { |
| 159 | NewGRFProfiler::AbortTimer(); |
| 160 | |
| 161 | uint64_t max_ticks = 0; |
| 162 | uint32_t total_microseconds = 0; |
| 163 | for (NewGRFProfiler &pr : _newgrf_profilers) { |
| 164 | if (pr.active) { |
| 165 | total_microseconds += pr.Finish(); |
| 166 | max_ticks = std::max(max_ticks, TimerGameTick::counter - pr.start_tick); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | if (total_microseconds > 0 && max_ticks > 0) { |
| 171 | IConsolePrint(CC_DEBUG, "Total NewGRF callback processing: {} microseconds over {} ticks.", total_microseconds, max_ticks); |
| 172 | } |
| 173 | |
| 174 | return total_microseconds; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Check whether profiling is active and should be finished. |
nothing calls this directly
no test coverage detected