1CURLINFO_REDIRECT_TIME(3) curl_easy_getinfo options CURLINFO_REDIRECT_TIME(3)
2
3
4
6 CURLINFO_REDIRECT_TIME - get the time for all redirection steps
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_TIME, double
12 *timep);
13
15 Pass a pointer to a double to receive the total time, in seconds, it
16 took for all redirection steps include name lookup, connect, pretrans‐
17 fer and transfer before final transaction was started. CURLINFO_REDI‐
18 RECT_TIME contains the complete execution time for multiple redirec‐
19 tions.
20
21 See also the TIMES overview in the curl_easy_getinfo(3) man page.
22
24 All
25
27 curl = curl_easy_init();
28 if(curl) {
29 double redirect;
30 curl_easy_setopt(curl, CURLOPT_URL, url);
31 res = curl_easy_perform(curl);
32 if(CURLE_OK == res) {
33 res = curl_easy_getinfo(curl, CURLINFO_REDIRECT_TIME, &redirect);
34 if(CURLE_OK == res) {
35 printf("Time: %.1f", redirect);
36 }
37 }
38 /* always cleanup */
39 curl_easy_cleanup(curl);
40 }
41
43 Added in 7.9.7
44
46 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
47 if not.
48
50 curl_easy_getinfo(3), curl_easy_setopt(3), CURLINFO_REDIRECT_TIME_T(3)
51
52
53
54libcurl 7.71.1 March 23, 2020 CURLINFO_REDIRECT_TIME(3)