emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/time.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/time.el,v
Date: Sat, 16 Feb 2008 03:29:43 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/02/16 03:29:43

Index: time.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/time.el,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -b -r1.101 -r1.102
--- time.el     8 Jan 2008 20:44:42 -0000       1.101
+++ time.el     16 Feb 2008 03:29:43 -0000      1.102
@@ -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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]