GNU bug report logs - #39099
26.3; display-time delay after PC sleep

Previous Next

Package: emacs;

Reported by: ynyaaa <at> gmail.com

Date: Sun, 12 Jan 2020 13:43:02 UTC

Severity: normal

Found in version 26.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 39099 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ynyaaa <at> gmail.com
Cc: Stefan Kangas <stefan <at> marxist.se>, 39099 <at> debbugs.gnu.org
Subject: Re: bug#39099: 26.3; display-time delay after PC sleep
Date: Mon, 30 Aug 2021 03:40:32 +0200
ynyaaa <at> gmail.com writes:

> Explicitly calling display-time restarts display-time-timer.
> Following lines are the contents of "display time log" buffer.
>
> Thu Jan 23 16:01:03 2020
> Thu Jan 23 16:02:00 2020
> Thu Jan 23 16:03:00 2020
> Thu Jan 23 16:04:00 2020

Right, because it's doing

(run-at-time t 60 ...)

which means that we should only run at each integral multiple of 60.

> Thu Jan 23 16:29:43 2020
> Thu Jan 23 16:29:43 2020
> Thu Jan 23 16:30:43 2020
> Thu Jan 23 16:31:43 2020

But then after sleeping, we're still running every 60 seconds -- but
it's not running on integral multiples?

Eli Zaretskii <eliz <at> gnu.org> writes:

> I don't think this is specific to Windows.  The underlying problem
> here is that our timers are interval timers: the next time a timer
> fires is set by adding the interval to the time it fires now.  So if
> Emacs doesn't get CPU for a long time, it will start counting time
> from the first moment it gets CPU again.

It sounds like something else is going on here.  It's adding 60 seconds
correctly -- but not computing the integral multiples correctly...  So
it sounds like somehow `timer-next-integral-multiple-of-time' is
computing things incorrectly after sleeping?

I had a look at the function, and I couldn't see anything obviously
wrong with it.

Here's a test case:

(format-time-string "%H:%M:%S"
  (timer-next-integral-multiple-of-time (current-time) 60))

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




This bug report was last modified 3 years and 263 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.