(define (test-io read write)
(let ((data (read)))
(note " reading")
- (dotimes repeats
- (lambda (i)
- (gc-flip)
- (show-time read)))
+ (for-each (lambda (i)
+ (gc-flip)
+ (show-time read))
+ (iota repeats))
(note " writing")
- (dotimes repeats
- (lambda (i)
- (gc-flip)
- (show-time (lambda () (write data)))))
+ (for-each (lambda (i)
+ (gc-flip)
+ (show-time (lambda () (write data))))
+ (iota repeats))
data))
(define (make-read-exprs with-input-port)
(define (note . objects)
(write-notification-line
(lambda (port)
- (for-each (lambda (object) (display object port)) objects))))
-
-(define (dotimes n procedure)
- (define (loop i)
- (if (<= i n)
- (begin (procedure i)
- (loop (1+ i)))))
- (loop 1))
\ No newline at end of file
+ (for-each (lambda (object) (display object port)) objects))))
\ No newline at end of file