Subject: bug#55163: 29.0.50; master 4a1f69ebca (TICKS . HZ) for current-time broke lsp-mode

From: Eli Zaretskii <[email-masked]>
Date: Sun, 01 May 2022 19:43:08 +0300

> Date: Sun, 1 May 2022 09:17:09 -0700
> Cc: [email-masked], [email-masked], [email-masked]
> From: Paul Eggert <[email-masked]>
> 
> On 5/1/22 08:42, Eli Zaretskii wrote:
> 
> > Out of these, only the 3rd one could qualify, because it's the only
> > one where performance counts.
> 
> I'm sure other places can be found like that. And even one such 
> occurrence can be enough motivation.

No, one such occurrence won't be enough, not in my book.

> > And then those issues will have to be handled by Lisp application
> > programmers?
> 
> No, not at all. We could write the code in Elisp and put it into 
> files.el or wherever. The point is that this sort of thing need not and 
> should not be written in C.

What's the difference, for the purpose of this discussion, between
having the code in C and having it in internal Lisp functions?  The
important conclusion is the same: no need for public APIs that expose
individual attributes.

> >> erc-server-send-ping, progress-reporter-do-update, timer-event-handler.
> >> I'm sure there are others.
> > 
> > We don't need wallclock time for those, only elapsed time since some
> > instant, right?  When elapsed time is used, the monotonicity issue
> > never arises.
> 
> I'm not sure what is meant by the distinction between a monotonic clock 
> and an elapsed-time clock. Either way, current-time does not suffice.

The distinction is that the resolution of the wallclock time doesn't
matter.

> GNU/Linux has many types of monotonic clocks. We don't need to expose 
> them all to the user. But Emacs apps do need at least one such clock, 
> and POSIX's CLOCK_MONOTONIC is a portable way to get one.

What we have established is that Emacs apps need to be able to measure
time intervals, not that they need a monotonic clock.  Functions for
measuring time intervals can be built on functions that return
monotonic clock time, but they can also be built on other bases that
have very little with actual time stamps.