[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Mathieu Othacehe |
Date: |
Sun, 30 May 2021 04:25:00 -0400 (EDT) |
branch: master
commit caf624a9100b1bac1d85996ea3fc75e908d6652a
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sun May 30 09:39:43 2021 +0200
Move call-with-time to (cuirass utils).
* src/cuirass/base.scm (call-with-time): Move it to ...
* src/cuirass/utils.scm: ... here.
---
src/cuirass/base.scm | 8 --------
src/cuirass/utils.scm | 11 ++++++++++-
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index db16420..1aee80a 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -196,14 +196,6 @@ any."
#:entry-expiration
gc-root-expiration-time))
-(define (call-with-time thunk kont)
- "Call THUNK and pass KONT the elapsed time followed by THUNK's return
-values."
- (let* ((start (current-time time-monotonic))
- (result (call-with-values thunk list))
- (end (current-time time-monotonic)))
- (apply kont (time-difference end start) result)))
-
(define (call-with-time-display thunk)
"Call THUNK and write to the current output port its duration."
(call-with-time thunk
diff --git a/src/cuirass/utils.scm b/src/cuirass/utils.scm
index f64d318..fe17a6c 100644
--- a/src/cuirass/utils.scm
+++ b/src/cuirass/utils.scm
@@ -56,7 +56,8 @@
bytevector-range
date->rfc822-str
- random-string))
+ random-string
+ call-with-time))
(define (alist? obj)
"Return #t if OBJ is an alist."
@@ -349,3 +350,11 @@ die silently while the rest of the program keeps going."
(let ((n (random 62 %seed)))
(loop (cons (integer->alphanumeric-char n) chars)
(- len 1))))))
+
+(define (call-with-time thunk kont)
+ "Call THUNK and pass KONT the elapsed time followed by THUNK's return
+values."
+ (let* ((start (current-time time-monotonic))
+ (result (call-with-values thunk list))
+ (end (current-time time-monotonic)))
+ (apply kont (time-difference end start) result)))
- master updated (58e3551 -> 9888431), Mathieu Othacehe, 2021/05/30
- [no subject], Mathieu Othacehe, 2021/05/30
- [no subject], Mathieu Othacehe, 2021/05/30
- [no subject], Mathieu Othacehe, 2021/05/30
- [no subject], Mathieu Othacehe, 2021/05/30
- [no subject],
Mathieu Othacehe <=
- [no subject], Mathieu Othacehe, 2021/05/30