diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-06-24 01:18:21 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-06-24 01:18:21 +0200 |
commit | 64ed44a815e4ee158ea1c0a57a714f0d501ad109 (patch) | |
tree | ea6852240dd9ae41ede610ce958edc33ea1ce4e4 | |
parent | 924cd3e25bf9c139a1675da965ab95df052dea9d (diff) | |
download | curl-64ed44a815e4ee158ea1c0a57a714f0d501ad109.tar.gz |
progress: fix "time spent", broke in adef394ac
-rw-r--r-- | lib/progress.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/progress.c b/lib/progress.c index ccabe3c5d..dce756b7b 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -361,18 +361,18 @@ int Curl_pgrsUpdate(struct connectdata *conn) now = Curl_tvnow(); /* what time is it */ /* The time spent so far (from the start) */ - data->progress.timespent = Curl_tvdiff_us(now, data->progress.start); - timespent = (curl_off_t)data->progress.timespent; + data->progress.timespent = Curl_tvdiff(now, data->progress.start); + timespent = (curl_off_t)data->progress.timespent/1000; /* integer seconds */ /* The average download speed this far */ data->progress.dlspeed = (curl_off_t) (data->progress.downloaded/ - (data->progress.timespent>0?data->progress.timespent:1)); + (timespent>0?timespent:1)); /* The average upload speed this far */ data->progress.ulspeed = (curl_off_t) (data->progress.uploaded/ - (data->progress.timespent>0?data->progress.timespent:1)); + (timespent>0?timespent:1)); /* Calculations done at most once a second, unless end is reached */ if(data->progress.lastshow != now.tv_sec) { |