[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cons-bomb
From: |
Thien-Thi Nguyen |
Subject: |
cons-bomb |
Date: |
Fri, 9 Nov 2001 12:49:40 -0800 |
yes, the world needs more meaningless stats!
fwiw on this box, (cons-bomb 1) => 28
(cons-bomb 2) => 1345
thi
________________________________________________________
;; Cons until THRESHOLD seconds elapse between
;; successive kilo-conses. Return final count.
;;
(define (cons-bomb threshold)
(let loop ((count 0) (stamp (current-time)) (waste '()))
(cond ((= 0 (remainder count 1000))
(if (< (- (current-time) stamp) threshold)
(loop (1+ count) (current-time) (cons cons waste))
(/ count 1000)))
(else (loop (1+ count) stamp (cons cons waste))))))
- cons-bomb,
Thien-Thi Nguyen <=