X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=macros.lisp;h=c83b3b64a19f9f9be26f9dd96daa9ed9213f6f6d;hp=1239eb46b6d7d7cce32b073edc15d0d53a23efe8;hb=f03310d76a2458e5efb45b89f8e6b087db7f4ed1;hpb=be59b033c63cc2cb0e5d516f602f6e932b128a4c diff --git a/macros.lisp b/macros.lisp index 1239eb4..c83b3b6 100644 --- a/macros.lisp +++ b/macros.lisp @@ -147,6 +147,15 @@ ,@body)) +(defmacro time-seconds (&body body) + (let ((t1 (gensym))) + `(let ((,t1 (get-internal-real-time))) + (values + (progn ,@body) + (coerce (/ (- (get-internal-real-time) ,t1) + internal-time-units-per-second) + 'double-float))))) + (defmacro time-iterations (n &body body) (let ((i (gensym)) (count (gensym)))