Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 18b3dd9

Browse files
committed
Display heap
1 parent 7f0154c commit 18b3dd9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/SimpleServer/SimpleServer.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ uint32_t deltaSSE = 10;
766766
uint32_t lastWS = 0;
767767
uint32_t deltaWS = 100;
768768

769+
uint32_t lastHeap = 0;
770+
769771
void loop() {
770772
uint32_t now = millis();
771773
if (now - lastSSE >= deltaSSE) {
@@ -779,4 +781,8 @@ void loop() {
779781
// }
780782
lastWS = millis();
781783
}
784+
if(now - lastHeap >= 2000) {
785+
Serial.printf("Free heap: %" PRIu32 "\n", ESP.getFreeHeap());
786+
lastHeap = now;
787+
}
782788
}

0 commit comments

Comments
 (0)