Game network library mmo
When developing game, you might need “Synchronizing time between two devices”.
Let’s check this out.
Synchronizing time between two devices is generally the way of using round trip latency (RTT).
Suppose that there are two devices; device A and B
* A->B: Send system time of A.
* B->A: Send  as it is.
On A, you can get RTT by subtracting time of  from system time of A.
* A->B: Send RTT and present time of A.
To get present time of A out of B, calculate:
* Present time of A =  + /2
NTP works similary.
But the nature of computer network means that RTT is not accurate when measured for once.
RTT is bit different from time to time. In case of wireless network, gap between measurments can be way bigger.
So, averaging measurments for several times will be much accurate.
In addition, ProudNet(proudnet.com) provides variety of fuctions for time synchronizing .
ProudNet provides function to get not only RTT of server but also between other clients connected to P2P,
using CNetClient, GetLastPing of CNetServer and GetRecentPing function.