curl / Mailing Lists / curl-library / Single Mail


Time measurements using CURL - Help required

From: s S via curl-library <>
Date: Tue, 6 Jun 2017 20:09:40 +0530


I am trying to find the following metrics for a http request and its
response using curl,

1. Client time - how much time is spent by http client (curl) in
establishing the connection and sending the query to the server.

2. Server time - how much time the server took in "processing" the query
and sending the response to the client.

3. Network time - The round trip time - for the network in between client
and server.

4. Total time - The total time spent by the client in initiating the
connection with server, sending the query and receiving the reply.

From the manuals, I could see that.
time_total could give "4. Total time" and
time_pretransfer could give "1.Client time",
(time_starttransfer) - (time_pretransfer) - (3.Network time) could give "2.
Server time".

I am not sure how to find the "Network time". The option of using half of
time_connect can give an approx value of network time in most of the
cases.This may not give the accurate value in case of retransmit during SYN

Please help by validating the above. In case if this require code changes
in CURL I am planning to do it and some hints here could be very useful.


Received on 2017-06-06