[Top][All Lists]

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

Re: Minibuffer tray to display current time and date

From: Jorge A. Alfaro-Murillo
Subject: Re: Minibuffer tray to display current time and date
Date: Sat, 25 Apr 2015 22:38:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Dan Espen writes:

address@hidden (Jorge A. Alfaro-Murillo) writes:
Thanks... I see, it seems like every time that the display-timer runs it updates its interval. That doesn't seem very efficient, but there could be a good reason why they did it that way.

How is that not efficient? That's exactly the way I did it about 30 years ago on an IBM mainframe. Works for anything you want running at a regular interval. First pop is 60 seconds. Odds are, it will pop at 61, or even 62 depending on system load, etc. So, the next wait should be 60, 59, or 58.

Well, I think that (run-at-time time repeat ...) already schedules the times to run at the correct times even if one is late, so there is no need to reschedule again even if the system load is high and misses one timing or more. The documentation in (info "(elisp) Timers") seems to imply so:

"A repeating timer nominally ought to run every REPEAT seconds, but remember that any invocation of a timer can be late. Lateness of one repetition has no effect on the scheduled time of the next repetition. For instance, if Emacs is busy computing for long enough to cover three scheduled repetitions of the timer, and then starts to wait, it will immediately call the timer function three times in immediate succession (presuming no other timers trigger before or between them)." Now the last part could be problematic if emacs is stopped or the systems goes into hibernation (?). But `timer-max-repeats' takes care of that. Am I missing something?


reply via email to

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