add tak function benchmark file

This commit is contained in:
Yuichi Nishiwaki 2013-10-28 22:08:57 +09:00
parent 98e5288b04
commit 397a6b5473
1 changed files with 21 additions and 0 deletions

21
etc/tak.scm Normal file
View File

@ -0,0 +1,21 @@
(define start #f)
(define end #f)
(define (time f)
(set! start (current-jiffy))
(f)
(set! end (current-jiffy))
(/ (- end start) (jiffies-per-second)))
(define (tak x y z)
(if (> x y)
(tak (tak (- x 1) y z)
(tak (- y 1) z x)
(tak (- z 1) x y))
y))
(define (f)
(tak 12 6 0))
(write (time f))