From 3b8565c33b58196ffe2e3dd8f23a73de57a268f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 9 Mar 2020 23:47:05 +0100 Subject: Sprinkled in some time prints. --- module/util/time.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 module/util/time.scm (limited to 'module/util/time.scm') diff --git a/module/util/time.scm b/module/util/time.scm new file mode 100644 index 00000000..004cb6dc --- /dev/null +++ b/module/util/time.scm @@ -0,0 +1,16 @@ +(define-module (util time) + :export (report-time!)) + + +(define report-time! + (let ((last 0)) + (lambda (fmt . args) + (let ((run (get-internal-run-time)) + ; (real (get-internal-real-time)) + ) + (format (current-error-port) "~7,4fs (+ ~,4fs) │ ~?~%" + (/ run internal-time-units-per-second) + (/ (- run last) internal-time-units-per-second) + ;; (/ real internal-time-units-per-second) + fmt args) + (set! last run))))) -- cgit v1.2.3