# HG changeset patch # User Juri Linkov # Date 1203203880 0 # Node ID 8172ec5d2dd0dc705dca507d990ae8ebb8f54549 # Parent 1aaa6ac14ee43f4257f06f0ac1345616854e77be (emacs-init-time): New function. diff -r 1aaa6ac14ee4 -r 8172ec5d2dd0 lisp/time.el --- 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