@@ -129,23 +129,25 @@ const __FlashStringHelper * getCPluginCFunctionName(CPlugin::Function function);
129129bool mustLogCFunction (CPlugin::Function function);
130130String getMiscStatsName (int stat);
131131
132+ void stopTimerTask (int T, int F, uint64_t statisticsTimerStart);
133+ void stopTimerController (int T, CPlugin::Function F, uint64_t statisticsTimerStart);
134+ void stopTimer (int L, uint64_t statisticsTimerStart);
135+ void addMiscTimerStat (int L, int64_t T);
132136
133137extern std::map<int , TimingStats> pluginStats;
134138extern std::map<int , TimingStats> controllerStats;
135139extern std::map<int , TimingStats> miscStats;
136140extern unsigned long timingstats_last_reset;
137141
138142# define START_TIMER const uint64_t statisticsTimerStart (getMicros64());
139- # define STOP_TIMER_TASK (T, F ) \
140- if (mustLogFunction(F)) pluginStats[(T) * 256 + (F)].add(usecPassedSince(statisticsTimerStart));
141- # define STOP_TIMER_CONTROLLER (T, F ) \
142- if (mustLogCFunction(F)) controllerStats[(T) * 256 + static_cast <int >(F)].add(usecPassedSince(statisticsTimerStart));
143+ # define STOP_TIMER_TASK (T, F ) stopTimerTask(T, F, statisticsTimerStart);
144+ # define STOP_TIMER_CONTROLLER (T, F ) stopTimerController(T, F, statisticsTimerStart);
143145
144146// #define STOP_TIMER_LOADFILE miscStats[LOADFILE_STATS].add(usecPassedSince(statisticsTimerStart));
145- # define STOP_TIMER (L ) if (Settings.EnableTimingStats()) { miscStats[L]. add ( usecPassedSince ( statisticsTimerStart)); }
147+ # define STOP_TIMER (L ) stopTimer(L, statisticsTimerStart);
146148
147149// Add a timer statistic value in usec.
148- # define ADD_TIMER_STAT (L, T ) if (Settings.EnableTimingStats()) { miscStats[L]. add ( T); }
150+ # define ADD_TIMER_STAT (L, T ) addMiscTimerStat(L, T);
149151
150152#else // if FEATURE_TIMING_STATS
151153
0 commit comments