emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/hyperdrive 5434098b4a 11/19: Show speed


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 5434098b4a 11/19: Show speed
Date: Thu, 1 Aug 2024 01:00:11 -0400 (EDT)

branch: elpa/hyperdrive
commit 5434098b4a8592e0371fb35202cf339413941c02
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Show speed
---
 hyperdrive-download-monitor.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hyperdrive-download-monitor.el b/hyperdrive-download-monitor.el
index c0957cb6e5..75c69481d0 100644
--- a/hyperdrive-download-monitor.el
+++ b/hyperdrive-download-monitor.el
@@ -62,13 +62,15 @@ UPDATE-INTERVAL seconds."
                  (current-size (or (and attributes
                                         (file-attribute-size attributes))
                                    0))
-                 (elapsed (float-time (time-subtract (current-time) 
started-at))))
+                 (elapsed (float-time (time-subtract (current-time) 
started-at)))
+                 (speed (/ current-size elapsed)))
       ;; TODO: Consider using `format-spec'.
       (erase-buffer)
       (insert preamble
               "Downloaded: " (file-size-human-readable current-size nil " ")
               " / " (file-size-human-readable total-size) "\n"
-              "Elapsed: " (format-seconds "%hh%mm%ss%z" elapsed)))))
+              "Elapsed: " (format-seconds "%hh%mm%ss%z" elapsed) "\n"
+              "Speed: " (file-size-human-readable speed) "/s"))))
 
 (defun h//download-monitor-close (buffer)
   "Close download monitor BUFFER."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]