unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5822: run-at-time and Setting system time
       [not found] ` <83aatlwy5x.fsf@gnu.org>
@ 2009-04-05  3:44   ` chandan
  0 siblings, 0 replies; 6+ messages in thread
From: chandan @ 2009-04-05  3:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 5822, help-gnu-emacs

Eli Zaretskii wrote:
>> Date: Fri, 02 Apr 2010 12:29:42 +0530
>> From: chandan <chandan.babu@globaledgesoft.com>
>> Cc: 
>>
>> (defun mwnn-timer-callback ()
>>   (message "Hi, inside mwnn-timer-callback"))
>>
>> (run-at-time "60" nil 'mwnn-timer-callback)
>>
>> The above code is supposed to cause mwnn-timer-callback to get invoked 
>> after 60 seconds. But if the system time is changed to a future date 
>> (say 20 seconds after the timer is started) the timer fires immediately.
>>
>> Is this is a bug in the emacs code. If yes, can this be rectified?
>>     
>
> I think this how the timers are supposed to behave.  They are not
> interval timers, if that's what you expected.
>
>   
Emacs seems to use setitimer & getitimer (interval timers) for 
implementing the timer module. This may be the cause of the problem. 
Using timer_create, timer_delete, timer_settime, timer_gettime etc.







^ permalink raw reply	[flat|nested] 6+ messages in thread

* run-at-time and Setting system time
@ 2010-04-02  6:59 chandan
       [not found] ` <83aatlwy5x.fsf@gnu.org>
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: chandan @ 2010-04-02  6:59 UTC (permalink / raw)
  To: help-gnu-emacs, bug-gnu-emacs

Hi,
    Consider the following code:

(defun mwnn-timer-callback ()
  (message "Hi, inside mwnn-timer-callback"))

(run-at-time "60" nil 'mwnn-timer-callback)

The above code is supposed to cause mwnn-timer-callback to get invoked 
after 60 seconds. But if the system time is changed to a future date 
(say 20 seconds after the timer is started) the timer fires immediately.

Is this is a bug in the emacs code. If yes, can this be rectified?

Regards,
mwnn




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: run-at-time and Setting system time
  2010-04-02  6:59 run-at-time and Setting system time chandan
       [not found] ` <83aatlwy5x.fsf@gnu.org>
@ 2010-04-02 17:36 ` J. David Boyd
  2011-09-18 20:02   ` bug#5823: " Lars Magne Ingebrigtsen
  2010-04-02 17:40 ` bug#5822: " Eli Zaretskii
  2010-04-02 18:55 ` Glenn Morris
  3 siblings, 1 reply; 6+ messages in thread
From: J. David Boyd @ 2010-04-02 17:36 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: bug-gnu-emacs

chandan <chandan.babu@globaledgesoft.com> writes:

> Hi,
>    Consider the following code:
>
> (defun mwnn-timer-callback ()
>  (message "Hi, inside mwnn-timer-callback"))
>
> (run-at-time "60" nil 'mwnn-timer-callback)
>
> The above code is supposed to cause mwnn-timer-callback to get invoked
> after 60 seconds. But if the system time is changed to a future date
> (say 20 seconds after the timer is started) the timer fires
> immediately.
>
> Is this is a bug in the emacs code. If yes, can this be rectified?
>
> Regards,
> mwnn


It sounds like a good thing to me.

Say the time is 13:00, and you do what you said.  You told the machine
to give an invocation at 13:01.  

If you move the clock ahead, the code _should_ run, as it is now past
13:01.

Dave





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#5822: run-at-time and Setting system time
  2010-04-02  6:59 run-at-time and Setting system time chandan
       [not found] ` <83aatlwy5x.fsf@gnu.org>
  2010-04-02 17:36 ` J. David Boyd
@ 2010-04-02 17:40 ` Eli Zaretskii
  2010-04-02 18:55 ` Glenn Morris
  3 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2010-04-02 17:40 UTC (permalink / raw)
  To: chandan; +Cc: 5822, help-gnu-emacs

> Date: Fri, 02 Apr 2010 12:29:42 +0530
> From: chandan <chandan.babu@globaledgesoft.com>
> Cc: 
> 
> (defun mwnn-timer-callback ()
>   (message "Hi, inside mwnn-timer-callback"))
> 
> (run-at-time "60" nil 'mwnn-timer-callback)
> 
> The above code is supposed to cause mwnn-timer-callback to get invoked 
> after 60 seconds. But if the system time is changed to a future date 
> (say 20 seconds after the timer is started) the timer fires immediately.
> 
> Is this is a bug in the emacs code. If yes, can this be rectified?

I think this how the timers are supposed to behave.  They are not
interval timers, if that's what you expected.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#5822: run-at-time and Setting system time
  2010-04-02  6:59 run-at-time and Setting system time chandan
                   ` (2 preceding siblings ...)
  2010-04-02 17:40 ` bug#5822: " Eli Zaretskii
@ 2010-04-02 18:55 ` Glenn Morris
  3 siblings, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2010-04-02 18:55 UTC (permalink / raw)
  To: chandan; +Cc: 5822, help-gnu-emacs


Please don't cross-post to the help and bug lists.

Anyone reading this on help-gnu-emacs, please use 5822 at
debbugs.gnu.org in place of bug-gnu-emacs in any replies. (Otherwise
every reply creates a new bug report.)


If you really want to cc another address when filing a new bug report,
please use an X-Debbugs-CC header instead of a Cc header, as explained
here:

http://debbugs.gnu.org/Reporting.html#xcc

Yes, it is a bit confusing at first.

Thanks.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#5823: run-at-time and Setting system time
  2010-04-02 17:36 ` J. David Boyd
@ 2011-09-18 20:02   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-18 20:02 UTC (permalink / raw)
  To: J. David Boyd; +Cc: 5823

david@adboyd.com (J. David Boyd) writes:

>> (defun mwnn-timer-callback ()
>>  (message "Hi, inside mwnn-timer-callback"))
>>
>> (run-at-time "60" nil 'mwnn-timer-callback)
>>
>> The above code is supposed to cause mwnn-timer-callback to get invoked
>> after 60 seconds. But if the system time is changed to a future date
>> (say 20 seconds after the timer is started) the timer fires
>> immediately.
>>
>> Is this is a bug in the emacs code. If yes, can this be rectified?
>>
>> Regards,
>> mwnn
>
> It sounds like a good thing to me.
>
> Say the time is 13:00, and you do what you said.  You told the machine
> to give an invocation at 13:01.  
>
> If you move the clock ahead, the code _should_ run, as it is now past
> 13:01.

Yes, I don't think this is a bug, so I'm closing this report.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-18 20:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-02  6:59 run-at-time and Setting system time chandan
     [not found] ` <83aatlwy5x.fsf@gnu.org>
2009-04-05  3:44   ` bug#5822: " chandan
2010-04-02 17:36 ` J. David Boyd
2011-09-18 20:02   ` bug#5823: " Lars Magne Ingebrigtsen
2010-04-02 17:40 ` bug#5822: " Eli Zaretskii
2010-04-02 18:55 ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).