Codechange: rework NewGRFProfiler to use ticks instead of calendar-days (#10815)

We are planning to allow things like freezing the calendar, which
makes this variable a bit problemetic. So instead, suggest to the
user how many ticks there are in a calendar day, and let them figure
out how many ticks they want.

Additionally, use a TimeoutTimer for this, instead of an end-date
variable which is checked in an IntervalTimer.
This commit is contained in:
Patric Stout
2023-05-13 23:17:11 +02:00
committed by GitHub
parent a372c59483
commit 1fe7bbba8a
3 changed files with 29 additions and 21 deletions
+2 -1
View File
@@ -34,6 +34,8 @@ struct NewGRFProfiler {
void Abort();
std::string GetOutputFilename() const;
static void StartTimer(uint64 ticks);
static void AbortTimer();
static uint32 FinishAll();
/** Measurement of a single sprite group resolution */
@@ -56,6 +58,5 @@ struct NewGRFProfiler {
};
extern std::vector<NewGRFProfiler> _newgrf_profilers;
extern TimerGameCalendar::Date _newgrf_profile_end_date;
#endif /* NEWGRF_PROFILING_H */