diff options
author | EuAndreh <eu@euandre.org> | 2018-07-05 13:20:58 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2018-07-05 13:20:58 -0300 |
commit | b3111940a844e2ea28b30ecb2c25f9a79711006f (patch) | |
tree | 6e97c2abe4ba47d363441de0cc08079df791a7cb | |
parent | Cleanup Spacemacs custom Elisp code (diff) | |
download | dotfiles-b3111940a844e2ea28b30ecb2c25f9a79711006f.tar.gz dotfiles-b3111940a844e2ea28b30ecb2c25f9a79711006f.tar.xz |
Add measure-time utility helper macro
-rw-r--r-- | spacemacs.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spacemacs.el b/spacemacs.el index 8d5c5ee..9db0854 100644 --- a/spacemacs.el +++ b/spacemacs.el @@ -522,6 +522,14 @@ in the dump." ("M-SPC" . (lambda () (interactive) (just-one-space -1))) ("M-[" . (lambda () (interactive) (find-file "~/tmp/scratch.org"))))) +(defmacro 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)))) + (defun dotspacemacs/user-config () "Configuration function for user code. This function is called at the very end of Spacemacs initialization after layers configuration. |