guix-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Mathieu Othacehe
Date: Sat, 30 Jan 2021 10:12:15 -0500 (EST)

branch: master
commit 158dd2bd42c8b2ffbde07d5878d24ec26a7dadd4
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sat Jan 30 16:11:50 2021 +0100

    Fix build duration display.
    
    * src/cuirass/templates.scm (build-details): Fix build duration display.
---
 src/cuirass/templates.scm | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index c474bb7..ac29e2a 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -291,11 +291,17 @@ system whose names start with " (code "guile-") ":" (br)
       (tr (th "Name")
           (td ,(assq-ref build #:nix-name)))
       (tr (th "Duration")
-          (td ,(or (and-let* ((start (assq-ref build #:starttime))
-                              (stop  (assq-ref build #:stoptime)))
-                     (string-append (number->string (- stop start))
-                                    " seconds"))
-                   "—")))
+          (td ,(let ((timestamp (time-second (current-time time-utc)))
+                     (start (assq-ref build #:starttime))
+                     (stop  (assq-ref build #:stoptime)))
+                 (cond
+                  ((and (> start 0) (> stop 0))
+                   (string-append (number->string (- stop start))
+                                  " seconds"))
+                  ((> start 0)
+                   (string-append (number->string (- timestamp start))
+                                  " seconds"))
+                  (else "—")))))
       (tr (th "Finished")
           (td ,(if completed?
                    (time->string (assq-ref build #:stoptime))



reply via email to

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