help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: is there a emacs lisp timing command?


From: Helmut Eller
Subject: Re: is there a emacs lisp timing command?
Date: Tue, 24 Mar 2009 08:30:45 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

* Xah Lee [2009-03-24 02:57+0100] writes:

> anyone has written a timing command somewhere?

I've use this for ages:

;;;; CL-like time macro
(defmacro time (form)
  (autoload 'elp-elapsed-time "elp")
  (let ((start (make-symbol "#:start")))
    `(let ((,start (current-time)))
       (prog1 ,form
         (princ (format "Elapsed time: %.2f sec  \n"
                        (elp-elapsed-time ,start (current-time))))))))


Helmut.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]