home *** CD-ROM | disk | FTP | other *** search
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; File: timer.cl
- ; Description: The timer function for Gabriel's test suite.
- ; Author: Robert Kessler, Will Galway and Stan Shebs
- ; Created: 05-Mar-84
- ; Modified: 16-Dec-85 (Stan Shebs)
- ; Mode: PCLS
- ; Package: User
- ; Status: Experimental
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- ;;; Invoke this function to run a benchmark. The first argument is a string
- ;;; identifying the benchmark, while the second is the form to be evaluated.
-
- (defun run-benchmark (name form)
- (let ((fname (gentemp)))
- (eval `(defun ,fname () ,(build-timer-function name form)))
- (compile fname)
- (apply fname nil)))
-
- ;;; The following function builds the body of the timer function
-
- (defun build-timer-function (string form)
- (setq string (string string))
- `(progn
-
- (format t "~%--------------------------------------------------------~%")
- (format t "~A~%" ,string)
- (format t "Timing performed on ~A ~A running ~A ~A on ~A.~%"
- (machine-type) (machine-version)
- (software-type) (software-version)
- (machine-instance))
- (time ,form)))
-