How to estimate the time for HttpPostRequest data?

I use a spider with Ethernet to post sensor data to my server.
I have a RESTful web service in my server.
I use

HttpHelper.CreateHttpPostRequest

to post data.
I want to know the time interval between sending and receiving.

Could I use

req.ResponseReceived += new HttpRequest.ResponseHandler(req_ResponseReceived); 

to get a response time?

The time interval should be (response time/2)?

Thanks.

I use this to get the time in milliseconds

long msTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

If you get the value before the call and then subtract the reading after, you will have the time taken to do this in ms.

1 Like