mirror of
https://github.com/me-no-dev/ESPAsyncWebServer.git
synced 2025-09-26 22:30:56 +02:00
update sample
This commit is contained in:
@@ -205,10 +205,11 @@ void setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t lastSSE = 0;
|
uint32_t lastSSE = 0;
|
||||||
|
uint32_t delta = 1;
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
if (now - lastSSE > 2000) {
|
if (now - lastSSE >= delta) {
|
||||||
events.send(String("ping-") + now, "heartbeat", now);
|
events.send(String("ping-") + now, "heartbeat", now);
|
||||||
lastSSE = millis();
|
lastSSE = millis();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user