Skip to content

Instantly share code, notes, and snippets.

@takaxp
Last active March 30, 2020 00:46
Show Gist options
  • Select an option

  • Save takaxp/ffcfbf6558a272186012b5218bc0c9fc to your computer and use it in GitHub Desktop.

Select an option

Save takaxp/ffcfbf6558a272186012b5218bc0c9fc to your computer and use it in GitHub Desktop.
my:init-loading-time
;; .emacs/init.el の先頭に記述
(defconst before-load-init-time (current-time))
(defun my:init-loading-time ()
"Loading time of user init files including time for `after-init-hook'."
(let ((time1 (float-time
(time-subtract after-init-time before-load-init-time)))
(time2 (float-time
(time-subtract (current-time) before-load-init-time))))
(message (concat "Loading init files: %.0f [msec], "
"of which %.f [msec] for `after-init-hook'.")
(* 1000 time1) (* 1000 (- time2 time1)))))
(add-hook 'after-init-hook 'my:init-loading-time t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment