From 5a7a0bed5fd54e3bf83f20ace65f5e2d06d0f48b Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 17 Sep 2012 17:33:24 +0900 Subject: [PATCH] using parameterize for redirecting output in in prelude --- benchmarks/gabriel/chibi-prelude.scm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/benchmarks/gabriel/chibi-prelude.scm b/benchmarks/gabriel/chibi-prelude.scm index f00697a6..3f9fb1d1 100644 --- a/benchmarks/gabriel/chibi-prelude.scm +++ b/benchmarks/gabriel/chibi-prelude.scm @@ -1,5 +1,5 @@ -(import (chibi time) (scheme cxr) (srfi 33)) +(import (chibi time) (scheme cxr) (srfi 33) (srfi 39)) (define (timeval->milliseconds tv) (quotient (+ (* 1000000 (timeval-seconds tv)) (timeval-microseconds tv)) @@ -8,12 +8,9 @@ (define (time* thunk) (call-with-output-string (lambda (out) - (let* ((orig-output-port (current-output-port)) - (_ (current-output-port out)) - (start (car (get-time-of-day))) - (result (thunk)) + (let* ((start (car (get-time-of-day))) + (result (parameterize ((current-output-port out)) (thunk))) (end (car (get-time-of-day))) - (_ (current-output-port orig-output-port)) (msecs (- (timeval->milliseconds end) (timeval->milliseconds start)))) (display "user: ")