X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fretr.c;h=3838c8d69d0c680b4ceaa1c8d16430a3dc3a5b5d;hp=6fed26a1e5405bc92918fa34011bfd888389f196;hb=319f52d756238aca0ba7c671f529d336757806c5;hpb=e24bc5db1b2613cc669ec4d8b91477bdf0be5084 diff --git a/src/retr.c b/src/retr.c index 6fed26a1..3838c8d6 100644 --- a/src/retr.c +++ b/src/retr.c @@ -54,6 +54,9 @@ so, delete this exception statement from your version. */ /* Total size of downloaded files. Used to enforce quota. */ SUM_SIZE_INT total_downloaded_bytes; +/* Total download time in milliseconds. */ +double total_download_time; + /* If non-NULL, the stream to which output should be written. This stream is initialized when `-O' is used. */ FILE *output_stream; @@ -495,18 +498,18 @@ fd_read_line (int fd) return fd_read_hunk (fd, line_terminator, 128, FD_READ_LINE_MAX); } -/* Return a printed representation of the download rate, as - appropriate for the speed. If PAD is true, strings will be padded - to the width of 7 characters (xxxx.xx). */ -char * -retr_rate (wgint bytes, double msecs, bool pad) +/* Return a printed representation of the download rate, along with + the units appropriate for the download speed. */ + +const char * +retr_rate (wgint bytes, double msecs) { static char res[20]; static const char *rate_names[] = {"B/s", "KB/s", "MB/s", "GB/s" }; int units = 0; double dlrate = calc_rate (bytes, msecs, &units); - sprintf (res, pad ? "%7.2f %s" : "%.2f %s", dlrate, rate_names[units]); + sprintf (res, "%.2f %s", dlrate, rate_names[units]); return res; }