Fix call-with-time-logging in (guix-data-service utils)

It was just recording 0.
This commit is contained in:
Christopher Baines 2020-11-01 21:17:31 +00:00
parent e394d1d6ad
commit 6235c6e33b

View file

@ -32,13 +32,12 @@
(define (call-with-time-logging action thunk) (define (call-with-time-logging action thunk)
(simple-format #t "debug: Starting ~A\n" action) (simple-format #t "debug: Starting ~A\n" action)
(let ((start-time (current-time)))
(let-values (let-values
((result ((result (thunk)))
(thunk))) (let ((time-taken (- (current-time) start-time)))
(let* ((start-time (current-time))
(time-taken (- (current-time) start-time)))
(simple-format #t "debug: Finished ~A, took ~A seconds\n" (simple-format #t "debug: Finished ~A, took ~A seconds\n"
action time-taken) action time-taken))
(apply values result)))) (apply values result))))
(define-syntax-rule (with-time-logging action exp ...) (define-syntax-rule (with-time-logging action exp ...)