added execution time macro for debug

This commit is contained in:
ndwarshuis 2019-05-13 18:35:18 -04:00
parent 2f282212b3
commit 5f51ba5c5f
1 changed files with 8 additions and 0 deletions

View File

@ -149,6 +149,14 @@ OS is one of those in `system-type'."
"Execute BODY if the program BIN exists."
`(if (executable-find ,bin) (progn ,@body)
(print (format "Executable %s not found. Skipping." ,bin))))
(defmacro nd/time-exec (&rest body)
"Measure time it takes to execute BODY."
`(let ((-time (current-time)))
,@body
(->> -time time-since float-time
(format "Run time: %.06f seconds"))))
#+END_SRC
** functions
#+BEGIN_SRC emacs-lisp