aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libtest')
-rw-r--r--tests/libtest/lib500.c50
1 files changed, 32 insertions, 18 deletions
diff --git a/tests/libtest/lib500.c b/tests/libtest/lib500.c
index 677ab73a7..2a6c58bb5 100644
--- a/tests/libtest/lib500.c
+++ b/tests/libtest/lib500.c
@@ -96,36 +96,50 @@ int test(char *URL)
if(libtest_arg2) {
FILE *moo = fopen(libtest_arg2, "wb");
if(moo) {
- double time_namelookup;
- double time_connect;
- double time_pretransfer;
- double time_starttransfer;
- double time_total;
+ curl_off_t time_namelookup;
+ curl_off_t time_connect;
+ curl_off_t time_pretransfer;
+ curl_off_t time_starttransfer;
+ curl_off_t time_total;
fprintf(moo, "IP: %s\n", ipstr);
- curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME, &time_namelookup);
- curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &time_connect);
- curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME, &time_pretransfer);
- curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME,
+ curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME_T, &time_namelookup);
+ curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME_T, &time_connect);
+ curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME_T,
+ &time_pretransfer);
+ curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME_T,
&time_starttransfer);
- curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &time_total);
+ curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME_T, &time_total);
/* since the timing will always vary we only compare relative
differences between these 5 times */
if(time_namelookup > time_connect) {
- fprintf(moo, "namelookup vs connect: %f %f\n",
- time_namelookup, time_connect);
+ fprintf(moo, "namelookup vs connect: %" CURL_FORMAT_CURL_OFF_T
+ ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n",
+ (time_namelookup / 1000000),
+ (long)(time_namelookup % 1000000),
+ (time_connect / 1000000), (long)(time_connect % 1000000));
}
if(time_connect > time_pretransfer) {
- fprintf(moo, "connect vs pretransfer: %f %f\n",
- time_connect, time_pretransfer);
+ fprintf(moo, "connect vs pretransfer: %" CURL_FORMAT_CURL_OFF_T
+ ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n",
+ (time_connect / 1000000), (long)(time_connect % 1000000),
+ (time_pretransfer / 1000000),
+ (long)(time_pretransfer % 1000000));
}
if(time_pretransfer > time_starttransfer) {
- fprintf(moo, "pretransfer vs starttransfer: %f %f\n",
- time_pretransfer, time_starttransfer);
+ fprintf(moo, "pretransfer vs starttransfer: %" CURL_FORMAT_CURL_OFF_T
+ ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n",
+ (time_pretransfer / 1000000),
+ (long)(time_pretransfer % 1000000),
+ (time_starttransfer / 1000000),
+ (long)(time_starttransfer % 1000000));
}
if(time_starttransfer > time_total) {
- fprintf(moo, "starttransfer vs total: %f %f\n",
- time_starttransfer, time_total);
+ fprintf(moo, "starttransfer vs total: %" CURL_FORMAT_CURL_OFF_T
+ ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n",
+ (time_starttransfer / 1000000),
+ (long)(time_starttransfer % 1000000),
+ (time_total / 1000000), (long)(time_total % 1000000));
}
fclose(moo);