gmag11 / ESPNtpClient

High accuracy NTP library for ESP32 and ESP8266
MIT License
118 stars 25 forks source link

Basic Demo - suggested update #51

Open tfcroft4 opened 10 months ago

tfcroft4 commented 10 months ago

In the basic demo there is a millisecond drift in the output. I think changing the code like so gives output every 1000ms rather than 1001ms

void loop() {
    static int last = 0;

    if ((millis () - last) **>=** SHOW_TIME_PERIOD) {
        last = millis ();
        Serial.println (NTP.getTimeDateStringUs ());
    }
}
gmag11 commented 10 months ago

Hi, thank you for reporting. That's true. I'll fix it now