GNURLINFO_...NSFER_TIME(3)
π GNURLINFO_...NSFER_TIME(3) β bestie, this is your girl's guide to CURLINFO_STARTTRANSFER_TIME β¨
okay so real talk, this page lives in the curl_easy_getinfo options section of the manual, and the whole thing is filed under <rainbow>GNURLINFO_...NSFER_TIME(3) β yes the title is truncated, no it's not a typo, the manual page name generator just did That π
anyway. sit down, grab a strawberry drink π, we're timing bytes.
πΈ NAME πΈ
CURLINFO_STARTTRANSFER_TIME β literally the get-the-time-until-the-first-byte-is-received girlie π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_STARTTRANSFER_TIME,
double *timep);
π¦ DESCRIPTION π¦
so what you're doing here is passing a pointer to a double, and that double is gonna be filled in with the time β in seconds β±οΈ β that it took from the very start until the first byte was received by libcurl. no cap.
and it's not just some lone number, bestie: this time includes CURLINFO_PRETRANSFER_TIME(3) (yes, the whole pretransfer moment) and it also includes the time the server needs to actually calculate the result. the server was doing its little math homework and we're counting it πβ¨
π oh and heads up: when a redirect is followed, the time from each request is added together. every hop counts, no skipping.
also go peek at the TIMES overview in the curl_easy_getinfo(3) man page if you want the full timeline lore, iykyk.
π PROTOCOLS π
All of them. every single one. main character protocol energy π
π₯ EXAMPLE π₯
curl = curl_easy_init();
if(curl) {
double start;
curl_easy_setopt(curl, CURLOPT_URL, url);
res = curl_easy_perform(curl);
if(CURLE_OK == res) {
res = curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &start);
if(CURLE_OK == res) {
printf("Time: %.1f", start);
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
not the /* always cleanup */ comment being the most responsible thing on this whole page π yes bestie, curl_easy_cleanup(curl); β always. periodt.
π AVAILABILITY π
Added in 7.9.2 β vintage icon behavior, honestly.
β RETURN VALUE β
- Returns
CURLE_OKif the option is supported β¨ - and
CURLE_UNKNOWN_OPTIONif it's not π
π«Ά SEE ALSO π«Ά
okay that's the whole page, you ate that π½οΈπ go time some bytes β this was libcurl 7.44.0, dated 28 Aug 2015, filed under GNURLINFO_...NSFER_TIME(3), mwah πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms