aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-03-01 21:59:59 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-03-01 21:59:59 +0000
commit5fb1d20ed95faca8d076e1ffd82bec7e73f38fa3 (patch)
tree455b28b67edd02a13788629afb6177e2104d8276
parent4ff9f2b08e3fc000d78e790fe355f0ed527266dd (diff)
added pgrsTime() to store various time stamps for the -w option
-rw-r--r--lib/progress.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/lib/progress.c b/lib/progress.c
index e07667c2b..4307be35e 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -111,6 +111,28 @@ void pgrsMode(struct UrlData *data, int mode)
}
+void pgrsTime(struct UrlData *data, timerid timer)
+{
+ switch(timer) {
+ default:
+ case TIMER_NONE:
+ /* mistake filter */
+ break;
+ case TIMER_NAMELOOKUP:
+ data->progress.t_nslookup = tvnow();
+ break;
+ case TIMER_CONNECT:
+ data->progress.t_connect = tvnow();
+ break;
+ case TIMER_PRETRANSFER:
+ data->progress.t_pretransfer = tvnow();
+ break;
+ case TIMER_POSTRANSFER:
+ /* this is the normal end-of-transfer thing */
+ break;
+ }
+}
+
void pgrsStartNow(struct UrlData *data)
{
data->progress.start = tvnow();
@@ -280,15 +302,15 @@ void pgrsUpdate(struct UrlData *data)
fprintf(stderr,
"\r%3d %s %3d %s %3d %s %s %s %s %s %s %s",
- (int)total_percen, /* total % */
- max5data(total_expected_transfer, max5[2]), /* total size */
- (int)dlpercen, /* rcvd % */
+ (int)total_percen, /* total % */
+ max5data(total_expected_transfer, max5[2]), /* total size */
+ (int)dlpercen, /* rcvd % */
max5data(data->progress.downloaded, max5[0]), /* rcvd size */
- (int)ulpercen, /* xfer % */
- max5data(data->progress.uploaded, max5[1]), /* xfer size */
+ (int)ulpercen, /* xfer % */
+ max5data(data->progress.uploaded, max5[1]), /* xfer size */
- max5data(data->progress.dlspeed, max5[3]), /* avrg dl speed */
- max5data(data->progress.ulspeed, max5[4]), /* avrg ul speed */
+ max5data(data->progress.dlspeed, max5[3]), /* avrg dl speed */
+ max5data(data->progress.ulspeed, max5[4]), /* avrg ul speed */
time_total, /* total time */
time_current, /* current time */
time_left, /* time left */