1CURLINFO_PRETRANSFER_TIME_T(c3u)rl_easy_getinfo optiCoUnRsLINFO_PRETRANSFER_TIME_T(3)
2
3
4
6 CURLINFO_PRETRANSFER_TIME_T - get the time until the file transfer
7 start
8
10 #include <curl/curl.h>
11
12 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRETRANSFER_TIME_T,
13 curl_off_t *timep);
14
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 See also the TIMES overview in the curl_easy_getinfo(3) man page.
23
25 All
26
28 curl = curl_easy_init();
29 if(curl) {
30 curl_off_t pretransfer;
31 curl_easy_setopt(curl, CURLOPT_URL, url);
32 res = curl_easy_perform(curl);
33 if(CURLE_OK == res) {
34 res = curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME_T, &pretransfer);
35 if(CURLE_OK == res) {
36 printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", pretransfer / 1000000,
37 (long)(pretransfer % 1000000));
38 }
39 }
40 /* always cleanup */
41 curl_easy_cleanup(curl);
42 }
43
45 Added in 7.61.0
46
48 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
49 if not.
50
52 curl_easy_getinfo(3), curl_easy_setopt(3), CURLINFO_PRETRANSFER_TIME(3)
53
54
55
56libcurl 7.64.0 May 17, 2018 CURLINFO_PRETRANSFER_TIME_T(3)