From 2736785af7b2aca67dcf0e241129f4565531ebc2 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 16 Feb 2008 03:29:43 +0000 Subject: [PATCH] (emacs-uptime): Move here from time-date.el. --- lisp/time.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lisp/time.el b/lisp/time.el index f451529cb0d..c9ca2059b7b 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -548,6 +548,20 @@ 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))))))) + +;;;###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 -- 2.39.5