I have a threadpool in which threads are calling an api with different bodies. Its a post call. Currently I am mesauring response time like this.
long start = System.currentTimeMillis();
restTemplate call.
long end = System.currentTimeMillis()
responseTime = end - start;
I am assuming when restTemplate call will be made context will get switched by OS and no guarantee when it will be switched back. So how will the correct response time be measured.