aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2008-02-16 23:18:14 +0000
committerJuri Linkov2008-02-16 23:18:14 +0000
commit24d6c292eca4dffd5d77a8138ccdc39056efe917 (patch)
tree60140099b1a21391a3550845e0980a5a650264b7
parent5ab0e67e804a4b2f8ba2775ac93d5f65f7307759 (diff)
downloademacs-24d6c292eca4dffd5d77a8138ccdc39056efe917.tar.gz
emacs-24d6c292eca4dffd5d77a8138ccdc39056efe917.zip
(emacs-init-time): New function.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/time.el13
2 files changed, 19 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6b7cc5bda2c..7108ceb22dc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12008-02-16 Juri Linkov <juri@jurta.org>
2
3 * startup.el (after-init-time): New variable.
4 (command-line): Set `after-init-time' to the current time.
5
6 * time.el (emacs-init-time): New function.
7
12008-02-16 Stefan Monnier <monnier@iro.umontreal.ca> 82008-02-16 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * files.el (locate-dominating-file): Remove initial loop because it's 10 * 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'."
548 (when (equal (symbol-name (aref elt 5)) "display-time-world-timer") 548 (when (equal (symbol-name (aref elt 5)) "display-time-world-timer")
549 (cancel-timer elt))))))) 549 (cancel-timer elt)))))))
550 550
551
552;;;###autoload 551;;;###autoload
553(defun emacs-uptime (&optional format) 552(defun emacs-uptime (&optional format)
554 "Return a string giving the uptime of this instance of Emacs. 553 "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\"."
563 (message "%s" str) 562 (message "%s" str)
564 str))) 563 str)))
565 564
565;;;###autoload
566(defun emacs-init-time ()
567 "Return a string giving the duration of the Emacs initialization."
568 (interactive)
569 (let ((str
570 (format-seconds "%z%S"
571 (time-to-seconds
572 (time-subtract after-init-time before-init-time)))))
573 (if (interactive-p)
574 (message "%s" str)
575 str)))
576
566(provide 'time) 577(provide 'time)
567 578
568;;; arch-tag: b9c1623f-b5cb-48e4-b650-482a4d23c5a6 579;;; arch-tag: b9c1623f-b5cb-48e4-b650-482a4d23c5a6