12fd42abb3ba
Add `profile`
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Tue, 21 Feb 2017 20:50:17 +0000 |
parents | a0a09fcf271b |
children | 85823854b8cb |
branches/tags | (none) |
files | losh.lisp package.lisp |
Changes
--- a/losh.lisp Mon Feb 20 15:40:36 2017 +0000 +++ b/losh.lisp Tue Feb 21 20:50:17 2017 +0000 @@ -1968,6 +1968,14 @@ (sb-sprof::stop-profiling) (dump-profile filename)) +#+sbcl +(defmacro profile (&body body) + `(progn + (start-profiling) + (unwind-protect + (time (progn ,@body)) + (stop-profiling)))) + ;;;; CLOS --------------------------------------------------------------------- (defun build-slot-definition (conc-name slot-spec)