From 5f51ba5c5fba6bb923653280a28b62424ff40342 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Mon, 13 May 2019 18:35:18 -0400 Subject: [PATCH] added execution time macro for debug --- etc/conf.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etc/conf.org b/etc/conf.org index 07e68ca..a64c142 100644 --- a/etc/conf.org +++ b/etc/conf.org @@ -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