1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-04 11:40:22 +00:00

(emacs-init-time): New function.

This commit is contained in:
Juri Linkov 2008-02-16 23:18:14 +00:00
parent 5ab0e67e80
commit 24d6c292ec
2 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2008-02-16 Juri Linkov <juri@jurta.org>
* startup.el (after-init-time): New variable.
(command-line): Set `after-init-time' to the current time.
* time.el (emacs-init-time): New function.
2008-02-16 Stefan Monnier <monnier@iro.umontreal.ca> 2008-02-16 Stefan Monnier <monnier@iro.umontreal.ca>
* files.el (locate-dominating-file): Remove initial loop because it's * files.el (locate-dominating-file): Remove initial loop because it's

View File

@ -548,7 +548,6 @@ To turn off the world time display, go to that window and type `q'."
(when (equal (symbol-name (aref elt 5)) "display-time-world-timer") (when (equal (symbol-name (aref elt 5)) "display-time-world-timer")
(cancel-timer elt))))))) (cancel-timer elt)))))))
;;;###autoload ;;;###autoload
(defun emacs-uptime (&optional format) (defun emacs-uptime (&optional format)
"Return a string giving the uptime of this instance of Emacs. "Return a string giving the uptime of this instance of Emacs.
@ -563,6 +562,18 @@ For example, the Unix uptime command format is \"%D, %z%2h:%.2m\"."
(message "%s" str) (message "%s" str)
str))) str)))
;;;###autoload
(defun emacs-init-time ()
"Return a string giving the duration of the Emacs initialization."
(interactive)
(let ((str
(format-seconds "%z%S"
(time-to-seconds
(time-subtract after-init-time before-init-time)))))
(if (interactive-p)
(message "%s" str)
str)))
(provide 'time) (provide 'time)
;;; arch-tag: b9c1623f-b5cb-48e4-b650-482a4d23c5a6 ;;; arch-tag: b9c1623f-b5cb-48e4-b650-482a4d23c5a6