From 62f1c04ee3e8605e3851a47956854ff5d9674267 Mon Sep 17 00:00:00 2001 From: Neil McKechnie Date: Tue, 9 Mar 2021 10:30:20 +0000 Subject: [PATCH] Revert "Add optional loop time monitor." This reverts commit 7a2beda2a976777a12829d31917e5404832d05bf. --- CommandStation-EX.ino | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/CommandStation-EX.ino b/CommandStation-EX.ino index 1fe625a..2357638 100644 --- a/CommandStation-EX.ino +++ b/CommandStation-EX.ino @@ -134,31 +134,4 @@ void loop() LCD(2,F("Free RAM=%5db"), ramLowWatermark); } #endif - -// Optionally report average and maximum loop time -#if ENABLE_LOOP_MEASUREMENT - static unsigned long startTime = micros(); - static unsigned int maxElapsed = 0; - static unsigned long totalElapsed = 0; - static unsigned long count = 0; - static unsigned long lastOutput = millis(); - - unsigned long endTime = micros(); - unsigned int elapsed = endTime - startTime; - - if (elapsed > maxElapsed) maxElapsed = elapsed; - count++; - totalElapsed += elapsed; - - unsigned long currentMillis = millis(); - if (currentMillis - lastOutput >= 5000) { - DIAG(F("\nLoop: max=%dus ave=%dus\n"), maxElapsed, totalElapsed/count); - maxElapsed = 0; - totalElapsed = 0; - count = 0; - lastOutput = currentMillis; - } - startTime = micros(); -#endif - }