emacs-devel
[Top][All Lists]
Advanced

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

Re: uptime.el


From: Leo
Subject: Re: uptime.el
Date: Wed, 19 Dec 2007 10:33:04 +0000
User-agent: Gnus/5.130000 Emacs/23.0.50 (20071101) Fedora 8 (gnu/linux)

On 2007-12-19 10:12 +0000, Richard Stallman wrote:
> What do people think of this?  (The patch in startup.el should be done
> differently.)

It is useful. For example, "10:30:10 Emacs up 9 day(s), 23:59". I have
put something like the following in .emacs for almost a year.

(defvar emacs-up-time (current-time)
  "Time at which Emacs started up.")
(defun uptime ()
  "Displays Emacs uptime."
  (interactive)
  (let* ((now (current-time))
         (second (floor (- (time-to-seconds now)
                           (time-to-seconds emacs-up-time))))
         (minute (floor second 60))
         (hour (floor minute 60))
         (day (floor hour 24)))
    (message "%s Emacs up %s day(s), %02d:%02d"
             (format-time-string "%T" now) day (% hour 24) (% minute 60))))

-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

          Use the best OS -- http://www.fedoraproject.org/





reply via email to

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