From 397a6b54732b4933f053237ddc4895594b4bb8e2 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 28 Oct 2013 22:08:57 +0900 Subject: [PATCH] add tak function benchmark file --- etc/tak.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 etc/tak.scm diff --git a/etc/tak.scm b/etc/tak.scm new file mode 100644 index 00000000..b3c4d46b --- /dev/null +++ b/etc/tak.scm @@ -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))