getServerTime and getRoundTripTime in main loop

edited November 2017 in Native
Using this functions :
+getServerTime ()

1. in main loop , consume lots bandwitdh ? consume very much cpu?
(Or photon uses estadistical internal vars for Ping ?)

main loop
t = getServerTime ()
r = getRoundTripTime()

2. getServerTime () return always negative values , is normal ?

i try to fix values using 2 functions in main loop

fetchServerTimestamp ()
t= getServerTime ()

values are negatives too..

3. getRoundTripTime returns 240 - 300 is normal ? my region is US
my PC in Colombia

Thanks 4 u help


  • I select region sao paulo (brazil ) "sa" and my ping is the same 250 ~ 300
  • KaiserludiKaiserludi admin
    edited November 2017
    Hi @coldev .

    getServerTime() and getRoundTripTime() both don't consume any bandwidth at all and both are extremely cheap in terms of CPU usage.


    getServerTime () return always negative values , is normal ?

    Yes, that is completely normal, just like for example can also return negative values.

    When you use RegionSelectionMode::SELECT, then the list of available regions and the list of the server IP addresses for a master server in each of those regions arrives in Listener::onAvailableRegions().
    You can just printf the master server addresses (the demo_loadBalancing implementation of the callback already does that) and then copy and paste the IP address of the us / sa region from the output.
    Please ping that address in an OS command line window (do not include the port).
    What ping results do you get for those IPs inthe command-line?
  • coldevcoldev
    edited November 2017
    Thanks 4 reply...

    Region EU
    ping (report country DE -> germany -> europe OK)
    Media = 237ms
    PhotonGame 250-300ms

    Region Us
    ping (America OK)
    Media = 188ms
    PhotonGame 200-230ms

    Region Sa
    ping (report country DE -> germany? not is sao paulo brazil ?)
    Media = 238ms
    PhotonGame 300-312ms

    My ping is normal ? My internet sucks? what is the normal ping in my region ?

  • edited November 2017
    I would like to see your traceroute resultes for the IP addresses you posted before to check if there is no routing issue. Please send to [email protected]:

    Windows: tracert
    Max/Linux: traceroute

    Please also include the result for region "USW":
Sign In or Register to comment.