aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-07-24 12:49:32 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-07-25 02:37:06 +0200
commitefb249b056fe7ff6a4788de510cf6c344f20612c (patch)
tree1820968952146bc8720dae4bb88429983ac36f16 /src
parent69e9709b33f05c167b17b7eb3455961e46dcee95 (diff)
downloadcuirass-efb249b056fe7ff6a4788de510cf6c344f20612c.tar
cuirass-efb249b056fe7ff6a4788de510cf6c344f20612c.tar.gz
evaluate: Use (cuirass ...) modules.
This avoids code duplication.
Diffstat (limited to 'src')
-rw-r--r--src/cuirass/base.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 666757e..496997a 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -47,8 +47,10 @@ values."
(define (call-with-time-display thunk)
"Call THUNK and write to the current output port its duration."
(call-with-time thunk
- (λ (time . results)
- (format #t "~,3f seconds~%"
- (+ (time-second time)
- (/ (time-nanosecond time) 1e9)))
- (apply values results))))
+ (λ (time result)
+ (let ((duration (+ (time-second time)
+ (/ (time-nanosecond time) 1e9))))
+ (format (current-error-port) "evaluate '~A': ~,3f seconds~%"
+ (assq-ref result #:job-name)
+ duration)
+ (acons #:duration duration result)))))