mirror of
https://github.com/moparisthebest/curl
synced 2024-10-31 15:45:12 -04:00
timespent is now updated in every call to the progress meter update function
This commit is contained in:
parent
64e80091db
commit
c43a9d9068
@ -212,14 +212,14 @@ int Curl_pgrsUpdate(struct UrlData *data)
|
|||||||
|
|
||||||
now = Curl_tvnow(); /* what time is it */
|
now = Curl_tvnow(); /* what time is it */
|
||||||
|
|
||||||
|
/* The exact time spent so far */
|
||||||
|
data->progress.timespent = Curl_tvdiff (now, data->progress.start);
|
||||||
|
|
||||||
if(data->progress.lastshow == Curl_tvlong(now))
|
if(data->progress.lastshow == Curl_tvlong(now))
|
||||||
return 0; /* never update this more than once a second if the end isn't
|
return 0; /* never update this more than once a second if the end isn't
|
||||||
reached */
|
reached */
|
||||||
data->progress.lastshow = now.tv_sec;
|
data->progress.lastshow = now.tv_sec;
|
||||||
|
|
||||||
/* The exact time spent so far */
|
|
||||||
data->progress.timespent = Curl_tvdiff (now, data->progress.start);
|
|
||||||
|
|
||||||
/* The average download speed this far */
|
/* The average download speed this far */
|
||||||
data->progress.dlspeed = data->progress.downloaded/(data->progress.timespent!=0.0?data->progress.timespent:1.0);
|
data->progress.dlspeed = data->progress.downloaded/(data->progress.timespent!=0.0?data->progress.timespent:1.0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user