guix-commits
[Top][All Lists]
Advanced

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

01/06: Fix call-with-time-logging in (guix-data-service utils)


From: Christopher Baines
Subject: 01/06: Fix call-with-time-logging in (guix-data-service utils)
Date: Sun, 1 Nov 2020 17:53:31 -0500 (EST)

cbaines pushed a commit to branch master
in repository data-service.

commit 6235c6e33b046119e85889b834a16ee484bf5e2b
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sun Nov 1 21:17:31 2020 +0000

    Fix call-with-time-logging in (guix-data-service utils)
    
    It was just recording 0.
---
 guix-data-service/utils.scm | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/guix-data-service/utils.scm b/guix-data-service/utils.scm
index 8ad60f9..7741671 100644
--- a/guix-data-service/utils.scm
+++ b/guix-data-service/utils.scm
@@ -32,14 +32,13 @@
 
 (define (call-with-time-logging action thunk)
   (simple-format #t "debug: Starting ~A\n" action)
-  (let-values
-      ((result
-         (thunk)))
-      (let* ((start-time (current-time))
-             (time-taken (- (current-time) start-time)))
+  (let ((start-time (current-time)))
+    (let-values
+        ((result (thunk)))
+      (let ((time-taken (- (current-time) start-time)))
         (simple-format #t "debug: Finished ~A, took ~A seconds\n"
-                       action time-taken)
-        (apply values result))))
+                       action time-taken))
+      (apply values result))))
 
 (define-syntax-rule (with-time-logging action exp ...)
   "Log under NAME the time taken to evaluate EXP."



reply via email to

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