Skip to content

Package: Synchronize your device time using the NTP protocol.

License

Notifications You must be signed in to change notification settings

toitlang/pkg-ntp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NTP

NTP (Network Time Protocol) client.

Fetches the current time from a NTP server (by default "pool.ntp.org").

This package does not update the system time.

Usage

import ntp
import esp32

main:
  result ::= ntp.synchronize
  if result:
    print "ntp: $result.adjustment ±$result.accuracy"
    esp32.adjust_real_time_clock result.adjustment