From 7029d287e52c77b8e06ace7fa2f5af8dd0150455 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 18 Jun 2017 23:37:58 +0200 Subject: [PATCH] Add doom/toggle-profiler --- core/autoload/debug.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/autoload/debug.el b/core/autoload/debug.el index 6d260a271..99262a8e3 100644 --- a/core/autoload/debug.el +++ b/core/autoload/debug.el @@ -79,3 +79,13 @@ selection of all minor-modes, active or not." (warn "Something went wrong.\n\n%s" (pp-to-string status)) (message "Your trust roots are set up properly.\n\n%s" (pp-to-string status)) t))))) + +(defvar doom--profiler nil) +;;;###autoload +(defun doom/toggle-profiler () + (interactive) + (if (not doom--profiler) + (profiler-start 'cpu+mem) + (profiler-report) + (profiler-stop)) + (setq doom--profiler (not doom--profiler)))