0

I have a client application that calls a web service hosted in iis on another server

var start = DateTime.Now.TimeOfDay;
var result = serviceClient.PerformOperation();
var timeConsumed = DateTime.Now.TimeOfDay - start;

The PerformOperation() method takes about 0.6s in the server monitor application (0.6s is the actual time consumed to perform the operation) but the value of timeConsumed is about 1.3 ~ 1.6s. So the communication between server and client takes about 0.7s.

How to calculate this time consumed by the network communication in c#?

  • http://stackoverflow.com/questions/770978/how-do-i-obtain-the-latency-between-server-and-client-in-c-sharp – Marcel N. Aug 12 '14 at 11:46
  • how this question is duplicated? – Mohamed Al-Hosary Aug 12 '14 at 11:56
  • You cannot get network latency at the level you want to (HTTP most likely). The other question has some indications about how you could do it. Unless you're willing to return from the server the time spent processing the request and then subtracting it on the client from the total duration, I think the other question applies. – Marcel N. Aug 12 '14 at 11:58

0 Answers0