# HG changeset patch # User Glenn Morris # Date 1203132583 0 # Node ID af26df6df4a9be249bd7eccea28ffde1439a723e # Parent d42d584a8a30d2d33210bc8b8ee9c718457081fc (emacs-uptime): Move here from time-date.el. diff -r d42d584a8a30 -r af26df6df4a9 lisp/time.el --- a/lisp/time.el Sat Feb 16 03:27:10 2008 +0000 +++ b/lisp/time.el Sat Feb 16 03:29:43 2008 +0000 @@ -548,6 +548,20 @@ (when (equal (symbol-name (aref elt 5)) "display-time-world-timer") (cancel-timer elt))))))) + +;;;###autoload +(defun emacs-uptime () + "Return a string giving the uptime of this instance of Emacs." + (interactive) + (let ((str + (format-seconds "%Y, %D, %H, %M, %S" + (time-to-seconds + (time-subtract (current-time) emacs-startup-time)) + t))) + (if (interactive-p) + (message "%s" str) + str))) + (provide 'time) ;;; arch-tag: b9c1623f-b5cb-48e4-b650-482a4d23c5a6