aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPhilip Prindeville <philipp@redfish-solutions.com>2018-05-17 13:37:36 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-05-17 13:41:04 +0200
commitce2140a8c12299f17bee406bad374e310daa94ed (patch)
treed762462ea05f6187ad9e00468b2087ffb2fd80a0 /lib
parentc5fe86804cce21db3b9902a44ea8903b3b211db0 (diff)
getinfo: add microsecond precise timers for various intervals
Provide a set of new timers that return the time intervals using integer number of microseconds instead of floats. The new info names are as following: CURLINFO_APPCONNECT_TIME_T CURLINFO_CONNECT_TIME_T CURLINFO_NAMELOOKUP_TIME_T CURLINFO_PRETRANSFER_TIME_T CURLINFO_REDIRECT_TIME_T CURLINFO_STARTTRANSFER_TIME_T CURLINFO_TOTAL_TIME_T Closes #2495
Diffstat (limited to 'lib')
-rw-r--r--lib/getinfo.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c
index d280eebfa..14b456274 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -281,6 +281,28 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info,
*param_offt = (data->progress.flags & PGRS_UL_SIZE_KNOWN)?
data->progress.size_ul:-1;
break;
+ case CURLINFO_TOTAL_TIME_T:
+ *param_offt = data->progress.timespent;
+ break;
+ case CURLINFO_NAMELOOKUP_TIME_T:
+ *param_offt = data->progress.t_nslookup;
+ break;
+ case CURLINFO_CONNECT_TIME_T:
+ *param_offt = data->progress.t_connect;
+ break;
+ case CURLINFO_APPCONNECT_TIME_T:
+ *param_offt = data->progress.t_appconnect;
+ break;
+ case CURLINFO_PRETRANSFER_TIME_T:
+ *param_offt = data->progress.t_pretransfer;
+ break;
+ case CURLINFO_STARTTRANSFER_TIME_T:
+ *param_offt = data->progress.t_starttransfer;
+ break;
+ case CURLINFO_REDIRECT_TIME_T:
+ *param_offt = data->progress.t_redirect;
+ break;
+
default:
return CURLE_UNKNOWN_OPTION;
}