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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user