+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>
* files.el (locate-dominating-file): Remove initial loop because it's
(when (equal (symbol-name (aref elt 5)) "display-time-world-timer")
(cancel-timer elt)))))))
-\f
;;;###autoload
(defun emacs-uptime (&optional format)
"Return a string giving the uptime of this instance of Emacs.
(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