From 0f77a5e45b5484145f3fc32c9d10bda3aff53273 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 16 Aug 2016 13:41:40 -0700 Subject: [PATCH] Add mesaure time macro --- dotfiles/emacs.d/README.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 813423aa..a1eecd19 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -633,6 +633,16 @@ the ~:around~ keyword of advice-add. (imalison:named-builder imalison:compose-around-builder) #+END_SRC +*** Measure Time +#+BEGIN_SRC emacs-lisp +(defmacro imalison:measure-time (&rest body) + "Measure and return the running time of the code block." + (declare (indent defun)) + (let ((start (make-symbol "start"))) + `(let ((,start (float-time))) + ,@body + (- (float-time) ,start)))) +#+END_SRC ** Flatten ~imenu~ Indexes I like my imenu indexes flat so I don't have to press enter multiple times to find what I'm looking for. The functions that follow allow me