From d45debc8e5905fa7f4d94d7c27ee510b2901567e Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 15 Jan 2020 19:54:32 +0000 Subject: Support prelude/time Write macro that wraps Elisp's builtin `benchmark` function. I'm doing this because `prelude/time` more closely resembles the API that I would expect. --- configs/shared/.emacs.d/wpc/prelude.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configs/shared/.emacs.d/wpc/prelude.el b/configs/shared/.emacs.d/wpc/prelude.el index c1579d558985..8bc2f283c7cf 100644 --- a/configs/shared/.emacs.d/wpc/prelude.el +++ b/configs/shared/.emacs.d/wpc/prelude.el @@ -133,5 +133,9 @@ This is a wrapper around `start-process' that has an API that resembles (f-exists? file) nil))) +(defmacro prelude/time (x) + "Print the time it takes to evaluate X." + `(benchmark 1 ',x)) + (provide 'prelude) ;;; prelude.el ends here -- cgit 1.4.1