refactor: record doom-init-time in doom-after-init-hook
This commit is contained in:
parent
dda848e089
commit
a3a275624e
2 changed files with 10 additions and 11 deletions
|
@ -163,6 +163,9 @@
|
|||
(defconst doom-modules-version "22.09.0-pre"
|
||||
"Current version of Doom Emacs.")
|
||||
|
||||
(defvar doom-init-time nil
|
||||
"The time it took, in seconds, for Doom Emacs to initialize.")
|
||||
|
||||
(defconst doom-profile
|
||||
(if-let (profile (getenv-internal "DOOMPROFILE"))
|
||||
(save-match-data
|
||||
|
@ -592,6 +595,11 @@ triggered. This is the absolute latest point in the startup process."
|
|||
(dolist (var '(exec-path load-path process-environment))
|
||||
(put var 'initial-value (default-toplevel-value var)))))
|
||||
|
||||
(add-hook! 'doom-after-init-hook :depth -110
|
||||
(defun doom--end-init-h ()
|
||||
"Set `doom-init-time'."
|
||||
(setq doom-init-time (float-time (time-subtract (current-time) before-init-time)))))
|
||||
|
||||
;; This is the absolute latest a hook can run in Emacs' startup process.
|
||||
(define-advice command-line-1 (:after (&rest _) run-after-init-hook)
|
||||
(doom-run-hooks 'doom-after-init-hook))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue