[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

if you are having trouble getting reasonable numbers for timing, use this time-it macro..



Cut the following code, paste it into your file and use it as

(time-it (your function that you want to time))

Lisp's macro facility is among the very best. Unlike defun, defmacro first constructs lisp code and then evaluates it. the backquote macro is a great way to
make templates...

(defmacro time-it (code)
  `(let ((begtime (get-internal-run-time)))
    ,code
   (float (/ (- (get-internal-run-time) begtime)
       internal-time-units-per-second))))

rao