Better frametime calculation in pitrix.cpp
This commit is contained in:
parent
efe9b924ec
commit
1418d519d5
@ -100,8 +100,17 @@ void loop() {
|
||||
last_loop_ago = 0;
|
||||
}
|
||||
|
||||
#ifdef MQTT_REPORT_METRICS
|
||||
unsigned long effect_loop_started = millis();
|
||||
#endif
|
||||
|
||||
current_effect->loop(last_loop_ago);
|
||||
|
||||
#ifdef MQTT_REPORT_METRICS
|
||||
metrics_frame_count++;
|
||||
metrics_frame_time += (millis() - effect_loop_started);
|
||||
#endif
|
||||
|
||||
// Save the time for the next run.
|
||||
_last_effect_loop_finished_at = now;
|
||||
|
||||
@ -109,10 +118,7 @@ void loop() {
|
||||
effect_clock.loop_with_invert(current_effect->clock_as_mask());
|
||||
}
|
||||
FastLED.show();
|
||||
#ifdef MQTT_REPORT_METRICS
|
||||
metrics_frame_count++;
|
||||
metrics_frame_time += (millis() - loop_started_at);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef RECORDER_ENABLE
|
||||
recorder->loop();
|
||||
|
Loading…
Reference in New Issue
Block a user