]> git.eshelyaron.com Git - emacs.git/commitdiff
(emacs-init-time): New function.
authorJuri Linkov <juri@jurta.org>
Sat, 16 Feb 2008 23:18:14 +0000 (23:18 +0000)
committerJuri Linkov <juri@jurta.org>
Sat, 16 Feb 2008 23:18:14 +0000 (23:18 +0000)
lisp/ChangeLog
lisp/time.el

index 6b7cc5bda2cf8006eefbc478460b92be4ebdca3f..7108ceb22dc811d2af677bb324c88e670d9779e8 100644 (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>
 
        * files.el (locate-dominating-file): Remove initial loop because it's
index 0613e1586bc6416ccb1fef522af1ef8040333e4d..7d0e3ebb1b7ec21b96535986ee746da9b3740368 100644 (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")
             (cancel-timer elt)))))))
 
-\f
 ;;;###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