Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
996 views
in Technique[技术] by (71.8m points)

http - Calculating Server Processing Time With Curl

I am getting request timing info with curl using the --write-out option as described in this article.

Here is example output from one of my requests:

        time_namelookup:  0.031
           time_connect:  0.328
        time_appconnect:  1.560
       time_pretransfer:  1.560
          time_redirect:  0.000
     time_starttransfer:  1.903
                        ----------
             time_total:  2.075

My question is: How can I determine how much time the server took processing the request? Is the answer:

time_starttransfer - time-connect

That is, the time from when the connection was established to when the server starting sending its response? That seems correct but I want to be sure.

Details about curl timing variables may be found here: http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Yes, (time_starttransfer - time-connect) is the time from the connect was noticed by curl until the first byte arrived. Do note that it also includes the transfer time so for a remote site it will be longer simply because of that.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...