]> sjero.net Git - wget/commitdiff
Print the total download time as part of the summary for recursive downloads.
authorJessica McKellar <jesstess@mit.edu>
Sun, 24 Oct 2010 19:45:30 +0000 (21:45 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 24 Oct 2010 19:45:30 +0000 (21:45 +0200)
ChangeLog
NEWS
src/ChangeLog
src/main.c

index 5e7780bd11bb6fddaa696d699f54efef9511fb8f..bd510b414e94b895ef443df50f36252a4680e0f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-10-24  Jessica McKellar <jesstess@mit.edu> (tiny change)
+
+       * NEWS: Mention the change to the the summary for recursive downloads.
+
 2010-10-23  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * configure.ac: Add check for libgpg-error and libgcrypt.
diff --git a/NEWS b/NEWS
index 4f2c3cae8e2bee7a33c170a30f9899f8123814fd..1e1df96ba5376d9bf935f27a48dd5ab3f769aef9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,8 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
    links.
 
 ** Use persistent connections with proxies supporting them.
+
+** Print the total download time as part of the summary for recursive downloads.
 \f
 * Changes in Wget 1.12
 
index 4c17f4a440a742f2afbecf37afcf884098168523..c0329cb1af9a558c8dd19615ff3ae51527fa9867 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-24  Jessica McKellar <jesstess@mit.edu> (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  <gscrivano@gnu.org>
 
        * gnutls.c (wgnutls_peek): Do not return an error when
index 98c17451ec55c1c9edf654ac45e3c55a0063ad18..1ed8e695894f7bafe6ca06ef6040cad2fb54dad6 100644 (file)
@@ -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 <getopt.h>
 #include <getpass.h>
@@ -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,