diff options
author | Christopher Baines <mail@cbaines.net> | 2019-06-21 15:47:32 +0200 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-06-21 15:47:53 +0200 |
commit | 766656086f3dbaa97d30d96564c084a5a77b007e (patch) | |
tree | 6ec75845b970a5924af6b51fc282de3edcecfdfa | |
parent | 398b8aab05ec884b8bc3013d13031c1b79466f72 (diff) | |
download | data-service-766656086f3dbaa97d30d96564c084a5a77b007e.tar data-service-766656086f3dbaa97d30d96564c084a5a77b007e.tar.gz |
Add a couple of functions around timing
That don't rely on timing a single function.
-rw-r--r-- | guix-data-service/jobs/load-new-guix-revision.scm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm index bd675e4..2743519 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -40,6 +40,18 @@ action time-taken) 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 inferior-%supported-systems (inferior-eval '(@ (guix packages) %supported-systems) inf)) |