|From:||Jorge A. Alfaro-Murillo|
|Subject:||Re: Minibuffer tray to display current time and date|
|Date:||Fri, 24 Apr 2015 10:57:42 -0400|
|User-agent:||Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)|
Eli Zaretskii writes:
Date: Fri, 24 Apr 2015 16:13:19 +0200 From: <address@hidden> Cc: address@hidden > > Optimal would be to run now, and then (run-at-time > > NEXT-TIME-MINUTE-CHANGES nil (lambda () (run-at-time t 60 > > ... > Are you thinking like this: "The granularity of the clock is > 1 minute. So it should be updated once every minute, i.e. > every 60 seconds." That sounds a bit risky to me, so I'd > recommend setting it so that it will be set somewhere around > three times per minute - and not set evenly so, but for > example every 22 seconds: > 0, 22, 44, 6 (66), 28, 50, ... This sounds a bit roundabout: why not run-at-time? Do you fear that it gets out of sync?Instead of arguing, just look at how display-time-mode does it, this problem is already solved there.
It does it exactly as I had proposed at the beginning (run-at-time t 60 ...)
But the clock might be off by at most 59 seconds, which is why it would be better to run once and then wait for the next time the minute changes to set the (run-at-time t 60 ...). Running every 22 seconds is very inefficient, two out three calls will not change anything.
|[Prev in Thread]||Current Thread||[Next in Thread]|