Skip to content

Instantly share code, notes, and snippets.

@ktakashi
Last active December 27, 2015 14:59
Show Gist options
  • Save ktakashi/7344518 to your computer and use it in GitHub Desktop.
Save ktakashi/7344518 to your computer and use it in GitHub Desktop.
bench mark result
$ sash etc/tak-sash.scm
0.62803584
$ ./bin/picrin.exe etc/tak.scm
1.404000
$ gosh etc/tak-gosh.scm
;(time (f))
; real 0.734
; user 0.734
; sys 0.000
12
(import (scheme time))
(define (time f)
(let ((start (current-jiffy)))
(f)
(inexact (/ (- (current-jiffy) 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))
(newline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment