]> git.eshelyaron.com Git - emacs.git/commitdiff
(emacs-uptime): Move here from time-date.el.
authorGlenn Morris <rgm@gnu.org>
Sat, 16 Feb 2008 03:29:43 +0000 (03:29 +0000)
committerGlenn Morris <rgm@gnu.org>
Sat, 16 Feb 2008 03:29:43 +0000 (03:29 +0000)
lisp/time.el

index f451529cb0da1e6781a7f0c0f2536c572c194e8c..c9ca2059b7b9743341c96d7b6467081c3dad4093 100644 (file)
@@ -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)))))))
 
+\f
+;;;###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