mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
output the full usec when --trace-time is used
This commit is contained in:
parent
72e532cb67
commit
cf2e365f23
@ -2817,16 +2817,15 @@ int my_trace(CURL *handle, curl_infotype type,
|
|||||||
const char *text;
|
const char *text;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
struct tm *now;
|
struct tm *now;
|
||||||
char timebuf[15];
|
char timebuf[20];
|
||||||
|
|
||||||
(void)handle; /* prevent compiler warning */
|
(void)handle; /* prevent compiler warning */
|
||||||
|
|
||||||
tv = curlx_tvnow();
|
tv = curlx_tvnow();
|
||||||
now = localtime(&tv.tv_sec); /* not multithread safe but we don't care */
|
now = localtime(&tv.tv_sec); /* not multithread safe but we don't care */
|
||||||
if(config->tracetime)
|
if(config->tracetime)
|
||||||
snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%02d ",
|
snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06d ",
|
||||||
now->tm_hour, now->tm_min, now->tm_sec,
|
now->tm_hour, now->tm_min, now->tm_sec, tv.tv_usec);
|
||||||
tv.tv_usec/10000);
|
|
||||||
else
|
else
|
||||||
timebuf[0]=0;
|
timebuf[0]=0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user