GNU bug report logs - #65251
30.0.50; Duration in compilation buffer

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Sat, 12 Aug 2023 18:32:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 65251 <at> debbugs.gnu.org (full text, mbox):

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: eller.helmut <at> gmail.com
Cc: 65251 <at> debbugs.gnu.org
Subject: bug#65251: 30.0.50; Duration in compilation buffer
Date: Wed, 16 Aug 2023 21:15:45 +0200
> In the *compilation* buffer, we see timestamps when the compilation
> started and finished.  It would be nice to also see how long the
> compilation command took.

Not a bad idea.
 
> +;; The time when the compilation started.
> +(defvar compilation--start-time nil)

What about using defvar-local? Then...

> +        (setq-local compilation--start-time (current-time))

can use plain setq. And if you use (float-time) here, then... 

> +     (let* ((secs (float-time (time-since compilation--start-time))))

...this becomes a simple subtraction: (- (float-time) compilation--start-time)

> +       (cond ((< secs 1) (format "%.0fms" (* secs 1000)))
> +	     ((< secs 10) (format "%.2fs" secs))
> +	     ((< secs 60) (format "%.1fs" secs))
> +	     (t (format-seconds "%hh%mm%z%ss" secs)))))

First of all, proper style is to separate the number and unit by a space.
The 'ms' case isn't very important -- 745 ms is no more readable than 0.745 s, probably less so.
The last case is also less than readable. Something like 3:45:58 would be better.

The reader would also like to know what this new time indication means. What about

   ..., duration 34.5 s

or

   ..., 34.5 s elapsed

?





This bug report was last modified 1 year and 298 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.