1CURLINFO_PRETRANSFER_TIME_T(3)      libcurl     CURLINFO_PRETRANSFER_TIME_T(3)
2
3
4

NAME

6       CURLINFO_PRETRANSFER_TIME_T  -  get  the  time  until the file transfer
7       start
8

SYNOPSIS

10       #include <curl/curl.h>
11
12       CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRETRANSFER_TIME_T,
13                                  curl_off_t *timep);
14

DESCRIPTION

16       Pass a pointer to a curl_off_t to receive the time, in microseconds, it
17       took  from  the  start  until the file transfer is just about to begin.
18       This includes all pre-transfer commands and negotiations that are  spe‐
19       cific  to  the particular protocol(s) involved. It does not involve the
20       sending of the protocol- specific request that triggers a transfer.
21
22       When a redirect is followed, the time from each request  is  added  to‐
23       gether.
24
25       See also the TIMES overview in the curl_easy_getinfo(3) man page.
26

PROTOCOLS

28       All
29

EXAMPLE

31       curl = curl_easy_init();
32       if(curl) {
33         curl_off_t pretransfer;
34         curl_easy_setopt(curl, CURLOPT_URL, url);
35         res = curl_easy_perform(curl);
36         if(CURLE_OK == res) {
37           res = curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME_T, &pretransfer);
38           if(CURLE_OK == res) {
39             printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", pretransfer / 1000000,
40                    (long)(pretransfer % 1000000));
41           }
42         }
43         /* always cleanup */
44         curl_easy_cleanup(curl);
45       }
46

AVAILABILITY

48       Added in 7.61.0
49

RETURN VALUE

51       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
52       if not.
53

SEE ALSO

55       curl_easy_getinfo(3), curl_easy_setopt(3), CURLINFO_PRETRANSFER_TIME(3)
56
57
58
59ibcurl 8.2.1                    April 26, 2023  CURLINFO_PRETRANSFER_TIME_T(3)
Impressum