Protocols and time transfer
NTP
Also: Network Time Protocol
NTP synchronises the clock of computers and devices over the network with a time server. It measures the round-trip delay and corrects the local clock in small steps.
Over the internet, NTP typically achieves an accuracy of a few milliseconds; on a local network, better. NTP works hierarchically through stratum levels.