Determines the execution time of a form in the current environment.
A form to be evaluated
The result of the evaluation of the form.
can be used to determine execution times. The macro evaluates the form given to it as argument, and prints out some timing and size data: the user and system times (in seconds), the elapsed time (in hours, minutes and seconds), and the total amount of heap space allocated in executing the form (in bytes).
The timing and size data covers all stack groups, not just the one that invokes
. Note that
itself uses a small, constant amount of heap space.
measures all threads, so to test accurately for consing in your code
you need to do:
This is particularly important when using the Common LispWorks IDE.
CL-USER 33 > (time (progn (format t "start")
(dotimes (a 100) nil)
(format t "end")))
Timing the evaluation of (PROGN (FORMAT T "start") (DOTIMES (A 100) NIL) (FORMAT T "end"))
User time = 0.000
System time = 0.000
Elapsed time = 0.000
Allocation = 5468 bytes
0 Page faults
Calls to %EVAL 1160
LispWorks Reference Manual - 12 Mar 2008