Add a couple of functions around timing

That don't rely on timing a single function.
This commit is contained in:
Christopher Baines 2019-06-21 15:47:32 +02:00
parent 398b8aab05
commit 766656086f

View file

@ -40,6 +40,18 @@
action time-taken) action time-taken)
result)) result))
(define (record-start-time action)
(simple-format #t "debug: Starting ~A\n" action)
(cons action
(current-time)))
(define record-end-time
(match-lambda
((action . start-time)
(let ((time-taken (- (current-time) start-time)))
(simple-format #t "debug: Finished ~A, took ~A seconds\n"
action time-taken)))))
(define (all-inferior-package-derivations store inf packages) (define (all-inferior-package-derivations store inf packages)
(define inferior-%supported-systems (define inferior-%supported-systems
(inferior-eval '(@ (guix packages) %supported-systems) inf)) (inferior-eval '(@ (guix packages) %supported-systems) inf))