I want to measure how long it spend when I post http request from server1 to server2, one thing I need consider is that, server1 and server2 are not in the same host, and there time is not consistent, my plan like this:
I need to post a parameter named startTime
before http request post to server2, the value is:
long startTime = System.currentTimeMillis();
When server2 received the request from server1, another variable name endTime
:
long endTime = System.currentTimeMillis();
and the result is :
long result = endTime - startTime;
if the time of server1 and server2 is not consistent, the result is meaningless, so I need to know how to get absolute time of startTime and endTime, can you help me ?