I am developing a mobile app, I need some parameters to implement the algorithm, and I do not know how to measure latency in a wifi network. Some people says using ping, but I do not know how implement this.
This is my first question, I am learning.
Thank you.
解决方案
Please have a look at this answer it might be what you are after
you might want to try the following code sample to measure time to do something
String host = "172.16.0.2";
int timeout = 3000;
long beforeTime = System.currentTimeMillis();
reachable = InetAddress.getByName(host).isReachable(timeout);
long afterTime = System.currentTimeMillis();
long timeDifference = afterTime - beforeTime;