Add mesaure time macro

This commit is contained in:
Ivan Malison 2016-08-16 13:41:40 -07:00
parent 311e20dfeb
commit 0f77a5e45b
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -633,6 +633,16 @@ the ~:around~ keyword of advice-add.
(imalison:named-builder imalison:compose-around-builder) (imalison:named-builder imalison:compose-around-builder)
#+END_SRC #+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 ** Flatten ~imenu~ Indexes
I like my imenu indexes flat so I don't have to press enter multiple 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 times to find what I'm looking for. The functions that follow allow me