From 46a82c7ab240a5a3f7c78da7af5f5fbe3c3bbcbd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 20 Feb 2017 16:42:07 -0500 Subject: [PATCH] Improve init benchmarking accuracy --- core/core-packages.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/core-packages.el b/core/core-packages.el index d167d871c..fa65bb1ad 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -1,5 +1,4 @@ ;;; core-packages.el -(defvar doom-start-time (current-time)) ;; Emacs package management is opinionated. Unfortunately, so am I. So with the ;; help of `use-package', `quelpa' and package.el, DOOM Emacs manages my @@ -59,6 +58,9 @@ package's name as a symbol, and whose CDR is the plist supplied to its "A list of packages that must be installed (and will be auto-installed if missing) and shouldn't be deleted.") +(defvar doom-init-time nil + "The time it took, in seconds, for DOOM Emacs to initialize.") + (defvar doom--base-load-path (append (list doom-core-dir doom-modules-dir) load-path) @@ -247,7 +249,7 @@ Used by `@require' and `@depends-on'." (defun doom--display-benchmark () (message "Loaded %s packages in %.03fs" (- (length load-path) (length doom--base-load-path)) - (float-time (time-subtract nil doom-start-time)))) + (setq doom-init-time (float-time (time-subtract after-init-time before-init-time))))) ;;