racket/collects/tests/mzscheme/benchmarks/common/mit-prelude.sch
Matthew Flatt 42e68c8ff1 even more benchmark scaffolding
svn: r17884
2010-01-29 16:33:15 +00:00

31 lines
683 B
Scheme

(declare (usual-integrations))
(define-syntax time
(syntax-rules ()
((_ expr)
(with-timings
(lambda () expr)
(lambda (run-time gc-time real-time)
(display "cpu: ")
(display run-time)
(display " real: ")
(display real-time)
(display " gc: ")
(display gc-time)
(newline))))))
(define-integrable (bitwise-and a b)
(if (and (fix:fixnum? a)
(fix:fixnum? b))
(fix:and a b)
0))
(define-integrable (bitwise-ior a b)
(if (and (fix:fixnum? a)
(fix:fixnum? b))
(fix:or a b)
0))
(define-integrable (bitwise-not a)
(if (fix:fixnum? a)
(fix:not a)
0))