How can i get latency when using Game Center?

Posted by Freddy on Game Development See other posts from Game Development or by Freddy
Published on 2014-06-12T15:30:55Z Indexed on 2014/06/12 15:42 UTC
Read the original article Hit count: 321

Filed under:
|

I'm pretty new to network programming. Basically I'm using game center for making a relatively simple iPhone game using Game-center p2p. However i'm now working on a algorithm to improve the multiplayer performance. But, I need to know how long it took for a package to travel from one device to the another device (latency) for the algorithm to work good. As for now, I have solved the problem by sending a double with time interval since 1970 in the package and then I compare it with the time at the other device. However I have heard that the NSDate methods is connected to the internet, which also will cause latency so the time interval would not be perfectly correct. What is the ideal way to check for how long it take for a package to be sent?

© Game Development or respective owner

Related posts about networking

Related posts about objective-c