1CURLINFO_TOTAL_TIME(3)     curl_easy_getinfo options    CURLINFO_TOTAL_TIME(3)
2
3
4

NAME

6       CURLINFO_TOTAL_TIME - get total time of previous transfer
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode  curl_easy_getinfo(CURL  *handle,  CURLINFO_TOTAL_TIME, double
12       *timep);
13

DESCRIPTION

15       Pass a pointer to a double to receive the total time in seconds for the
16       previous  transfer, including name resolving, TCP connect etc. The dou‐
17       ble represents the time in seconds, including fractions.
18
19       See also the TIMES overview in the curl_easy_getinfo(3) man page.
20

PROTOCOLS

22       All
23

EXAMPLE

25       curl = curl_easy_init();
26       if(curl) {
27         double total;
28         curl_easy_setopt(curl, CURLOPT_URL, url);
29         res = curl_easy_perform(curl);
30         if(CURLE_OK == res) {
31           res = curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &total);
32           if(CURLE_OK == res) {
33             printf("Time: %.1f", total);
34           }
35         }
36         /* always cleanup */
37         curl_easy_cleanup(curl);
38       }
39

AVAILABILITY

41       Added in 7.4.1
42

RETURN VALUE

44       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
45       if not.
46

SEE ALSO

48       curl_easy_getinfo(3), curl_easy_setopt(3), CURLINFO_TOTAL_TIME_T(3)
49
50
51
52libcurl 7.64.0                   May 17, 2018           CURLINFO_TOTAL_TIME(3)
Impressum