diff --git a/micropython/net/ntptime/ntptime.py b/micropython/net/ntptime/ntptime.py index 05d7e9717..fdd9434db 100644 --- a/micropython/net/ntptime/ntptime.py +++ b/micropython/net/ntptime/ntptime.py @@ -11,6 +11,8 @@ # The NTP host can be configured at runtime by doing: ntptime.host = 'myhost.org' host = "pool.ntp.org" +# The NTP socket timeout can be configured at runtime by doing: ntptime.timeout = 1.0 +timeout = 1.0 def time(): @@ -19,7 +21,7 @@ def time(): addr = socket.getaddrinfo(host, 123)[0][-1] s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: - s.settimeout(1) + s.settimeout(timeout) res = s.sendto(NTP_QUERY, addr) msg = s.recv(48) finally:
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: