arduino-libraries / NTPClient

Connect to a NTP server
533 stars 366 forks source link

Poll interval is much to often #185

Open Rki009 opened 1 year ago

Rki009 commented 1 year ago

https://github.com/arduino-libraries/NTPClient/blob/62fafd8eca51ebf8f5f4c7662e484caba0a4dcc1/NTPClient.h#L21

For simple embedded systems that just need to know the time +/- a second a recommended polling interval of 2^10 (1024 seconds) or longer is recommended to minimize the load on public time severs while providing accurate time. With a crystal with +/-50ppm accuracy a polling interval give +/-50 ms! This is in the range of network packet delay times for NTP itself for a typical embedded system. Very sufficient for second level accuracy. If you need better than this a $10 module can provide a pulse per second accurate time signal to an accuracy of 50 nanoseconds! There is no need for polling public time servers more often than once an hour.

unsigned long _updateInterval = (1024*1000);  // In ms, 2^10 seconds, 63 minutes

Related: https://github.com/arduino-libraries/NTPClient/issues/123