changeset 91894:8172ec5d2dd0

(emacs-init-time): New function.
author Juri Linkov <juri@jurta.org>
date Sat, 16 Feb 2008 23:18:00 +0000
parents 1aaa6ac14ee4
children 0c3cd5512b5d
files lisp/time.el
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/time.el	Sat Feb 16 23:17:51 2008 +0000
+++ b/lisp/time.el	Sat Feb 16 23:18:00 2008 +0000
@@ -548,7 +548,6 @@
           (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 @@
         (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