1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

Curl_pgrsTime: store now in an auto variable

It makes it easier to introduce debug outputs in this function, and
everything in the function is using the value anyway so it might even be
more efficient.
This commit is contained in:
Daniel Stenberg 2011-12-20 15:05:50 +01:00
parent ce896875f8
commit 51d4885ca0

View File

@ -157,6 +157,8 @@ void Curl_pgrsResetTimes(struct SessionHandle *data)
void Curl_pgrsTime(struct SessionHandle *data, timerid timer)
{
struct timeval now = Curl_tvnow();
switch(timer) {
default:
case TIMER_NONE:
@ -164,35 +166,34 @@ void Curl_pgrsTime(struct SessionHandle *data, timerid timer)
break;
case TIMER_STARTSINGLE:
/* This is set at the start of a single fetch */
data->progress.t_startsingle = Curl_tvnow();
data->progress.t_startsingle = now;
break;
case TIMER_NAMELOOKUP:
data->progress.t_nslookup =
Curl_tvdiff_secs(Curl_tvnow(), data->progress.t_startsingle);
Curl_tvdiff_secs(now, data->progress.t_startsingle);
break;
case TIMER_CONNECT:
data->progress.t_connect =
Curl_tvdiff_secs(Curl_tvnow(), data->progress.t_startsingle);
Curl_tvdiff_secs(now, data->progress.t_startsingle);
break;
case TIMER_APPCONNECT:
data->progress.t_appconnect =
Curl_tvdiff_secs(Curl_tvnow(), data->progress.t_startsingle);
Curl_tvdiff_secs(now, data->progress.t_startsingle);
break;
case TIMER_PRETRANSFER:
data->progress.t_pretransfer =
Curl_tvdiff_secs(Curl_tvnow(), data->progress.t_startsingle);
Curl_tvdiff_secs(now, data->progress.t_startsingle);
break;
case TIMER_STARTTRANSFER:
data->progress.t_starttransfer =
Curl_tvdiff_secs(Curl_tvnow(), data->progress.t_startsingle);
Curl_tvdiff_secs(now, data->progress.t_startsingle);
break;
case TIMER_POSTRANSFER:
/* this is the normal end-of-transfer thing */
break;
case TIMER_REDIRECT:
data->progress.t_redirect =
Curl_tvdiff_secs(Curl_tvnow(), data->progress.start);
data->progress.t_redirect = Curl_tvdiff_secs(now, data->progress.start);
break;
}
}