From 24d6c292eca4dffd5d77a8138ccdc39056efe917 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sat, 16 Feb 2008 23:18:14 +0000 Subject: [PATCH] (emacs-init-time): New function. --- lisp/ChangeLog | 7 +++++++ lisp/time.el | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6b7cc5bda2c..7108ceb22dc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2008-02-16 Juri Linkov + + * 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 * files.el (locate-dominating-file): Remove initial loop because it's diff --git a/lisp/time.el b/lisp/time.el index 0613e1586bc..7d0e3ebb1b7 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -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") (cancel-timer elt))))))) - ;;;###autoload (defun emacs-uptime (&optional format) "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) 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) ;;; arch-tag: b9c1623f-b5cb-48e4-b650-482a4d23c5a6 -- 2.39.5