From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) Newsgroups: gmane.emacs.help Subject: Re: Minibuffer tray to display current time and date Date: Sat, 25 Apr 2015 22:38:48 -0400 Message-ID: <87h9s3havb.fsf@yale.edu> References: <87h9s7hd7a.fsf@debian.uxu> <87383qvoi4.fsf@debian.uxu> <874mo6bgzx.fsf@debian.uxu> <20150424141319.GA19093@tuxteam.de> <831tj9zizy.fsf@gnu.org> <87ioclo9p5.fsf@yale.edu> <83wq11xyiu.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: ger.gmane.org 1430015976 3198 80.91.229.3 (26 Apr 2015 02:39:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Apr 2015 02:39:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 26 04:39:27 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YmCTZ-00040t-WB for geh-help-gnu-emacs@m.gmane.org; Sun, 26 Apr 2015 04:39:22 +0200 Original-Received: from localhost ([::1]:49743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmCTZ-0002zF-ED for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Apr 2015 22:39:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmCTP-0002vl-CI for help-gnu-emacs@gnu.org; Sat, 25 Apr 2015 22:39:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmCTK-0001Eo-O6 for help-gnu-emacs@gnu.org; Sat, 25 Apr 2015 22:39:11 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:36134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmCTK-0001AQ-HG for help-gnu-emacs@gnu.org; Sat, 25 Apr 2015 22:39:06 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YmCTF-0003dl-TE for help-gnu-emacs@gnu.org; Sun, 26 Apr 2015 04:39:02 +0200 Original-Received: from nat-130-132-173-151.central.yale.edu ([130.132.173.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 Apr 2015 04:39:01 +0200 Original-Received: from jorge.alfaro-murillo by nat-130-132-173-151.central.yale.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 Apr 2015 04:39:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nat-130-132-173-151.central.yale.edu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:/q6rtmik5Bw+V2Uu0SIUCymyonE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103997 Archived-At: Dan Espen writes: > jorge.alfaro-murillo@yale.edu (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? Best, -- Jorge.