From 69fb378d592613ec24bbc6854b585abb9b5d5c11 Mon Sep 17 00:00:00 2001 From: Jessica McKellar Date: Sun, 24 Oct 2010 21:45:30 +0200 Subject: [PATCH] Print the total download time as part of the summary for recursive downloads. --- ChangeLog | 4 ++++ NEWS | 2 ++ src/ChangeLog | 6 ++++++ src/main.c | 26 ++++++++++++++++++++------ 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e7780bd..bd510b41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-10-24 Jessica McKellar (tiny change) + + * NEWS: Mention the change to the the summary for recursive downloads. + 2010-10-23 Giuseppe Scrivano * configure.ac: Add check for libgpg-error and libgcrypt. diff --git a/NEWS b/NEWS index 4f2c3cae..1e1df96b 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,8 @@ Please send GNU Wget bug reports to . links. ** Use persistent connections with proxies supporting them. + +** Print the total download time as part of the summary for recursive downloads. * Changes in Wget 1.12 diff --git a/src/ChangeLog b/src/ChangeLog index 4c17f4a4..c0329cb1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-10-24 Jessica McKellar (tiny change) + + * main.c (main): Print the total download time as part of the + summary for downloads using the recursive or page requisites + options. Fixes bug #21359. + 2010-10-24 Giuseppe Scrivano * gnutls.c (wgnutls_peek): Do not return an error when diff --git a/src/main.c b/src/main.c index 98c17451..1ed8e695 100644 --- a/src/main.c +++ b/src/main.c @@ -55,6 +55,7 @@ as that of the covered work. */ #include "convert.h" #include "spider.h" #include "http.h" /* for save_cookies */ +#include "ptimer.h" #include #include @@ -877,6 +878,9 @@ main (int argc, char **argv) program_name = argv[0]; + struct ptimer *timer = ptimer_new (); + double start_time = ptimer_measure (timer); + i18n_initialize (); /* Construct the name of the executable, without the directory part. */ @@ -1347,13 +1351,23 @@ outputting to a regular file.\n")); && total_downloaded_bytes != 0) { + double end_time = ptimer_measure (timer); + ptimer_destroy (timer); + + char *wall_time = xstrdup (secs_to_human_time (end_time - start_time)); + char *download_time = xstrdup (secs_to_human_time (total_download_time)); logprintf (LOG_NOTQUIET, - _("FINISHED --%s--\nDownloaded: %d files, %s in %s (%s)\n"), - datetime_str (time (NULL)), - numurls, - human_readable (total_downloaded_bytes), - secs_to_human_time (total_download_time), - retr_rate (total_downloaded_bytes, total_download_time)); + _("FINISHED --%s--\nTotal wall clock time: %s\n" + "Downloaded: %d files, %s in %s (%s)\n"), + datetime_str (time (NULL)), + wall_time, + numurls, + human_readable (total_downloaded_bytes), + download_time, + retr_rate (total_downloaded_bytes, total_download_time)); + xfree (wall_time); + xfree (download_time); + /* Print quota warning, if exceeded. */ if (opt.quota && total_downloaded_bytes > opt.quota) logprintf (LOG_NOTQUIET, -- 2.39.2