From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: manikulin@gmail.com, emacs-devel@gnu.org
Subject: Re: Time resolution in Emacs argument optional ones
Date: Fri, 22 Apr 2022 14:52:47 -0700 [thread overview]
Message-ID: <9afbcc3d-b57c-b5bf-e4f6-52b352f99af8@cs.ucla.edu> (raw)
In-Reply-To: <83h76kq5c6.fsf@gnu.org>
On 4/22/22 12:35, Eli Zaretskii wrote:
> to do such comparisons correctly we need to
> have each time object state its resolution, otherwise you will never
> know how to compare them.
Yes, quite true.
> That resolution cannot be possibly determined by
> measuring the system clock resolution, because doing that will at best
> provide the figure for one class of time objects.
Also quite right. Emacs needs to determine the timestamp for each class
of objects as best it can.
> the current implementation of measuring that resolution
> fails miserably on MS-Windows, producing a very incorrect value.)
It's a correct value for what it's measuring, which is (roughly) the
number of digits needed to express each timestamp precisely. It's not
correct for a different measure, namely the timestamp resolution, which
it sounds like is what you'd prefer. As I mentioned in
<https://bugs.gnu.org/54764#111> it shouldn't be hard to support this
other measure, and I can look into doing that.
> What is the plan for other kinds of time objects? For example, how
> would we determine the resolution of file times
We could do what Coreutils does, in commands like 'cp -u' that sample
timestamps in each file system to determine resolution. This approach
works well enough in practice. There are Gnulib library functions to
deal with this sort of thing; it's not a new problem.
> as your examples show, that kind of timestamp is the one that needs
> resolution information much less than the other ones.
I don't see how the examples show that.
> Please don't be obsessed with MS-Windows.
There's no obsession here on my part. MS-Windows appears to be the only
platform where current-time generates such low-resolution timestamps, or
generates syncopated timestamps, and that's why discussion has naturally
centered on that platform.
> examples you gave deal with
> file timestamps, and you explained that we do risk losing information
> there.
Yes, and Emacs currently loses all information about file timestamp
resolution, on all platforms. It would be better for Emacs to report as
much of that information as it easily can. This could be done by using
the Gnulib library functions suggested above. Reporting this information
is better than losing it.
> even if we consider the (contrived) example with 'date'
> important for some reason, the result will be incorrect there for a
> couple of milliseconds, and thereafter will become correct, and who's
> to know, or care, that it was incorrect for those 2 milliseconds?
Yes, most users don't notice timestamps being a little off. And these
users surely won't care whether we improve the timestamps to be more
accurate. But that doesn't mean that it's a bad idea to improve
timestamp quality.
next prev parent reply other threads:[~2022-04-22 21:52 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 12:37 bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones Max Nikulin
2022-04-09 7:52 ` Paul Eggert
2022-04-09 7:52 ` Paul Eggert
2022-04-09 11:36 ` Max Nikulin
2022-04-10 3:57 ` Max Nikulin
2022-04-13 14:40 ` Max Nikulin
2022-04-13 14:40 ` Max Nikulin
2022-04-13 18:35 ` Paul Eggert
2022-04-13 18:35 ` Paul Eggert
2022-04-14 13:19 ` Max Nikulin
2022-04-14 22:46 ` Paul Eggert
2022-04-15 2:14 ` Tim Cross
2022-04-15 2:14 ` Tim Cross
2022-04-15 17:23 ` Max Nikulin
2022-04-15 17:23 ` Max Nikulin
2022-04-16 19:23 ` Paul Eggert
2022-04-16 19:23 ` Paul Eggert
2022-04-21 16:59 ` Max Nikulin
2022-04-21 16:59 ` Max Nikulin
2022-04-19 2:02 ` Paul Eggert
2022-04-19 2:02 ` Paul Eggert
2022-04-19 5:50 ` Eli Zaretskii
2022-04-19 22:22 ` Paul Eggert
2022-04-19 22:22 ` Paul Eggert
2022-04-20 7:23 ` Eli Zaretskii
2022-04-20 7:23 ` Eli Zaretskii
2022-04-20 18:19 ` Paul Eggert
2022-04-20 18:19 ` Paul Eggert
2022-04-20 18:41 ` Eli Zaretskii
2022-04-20 18:41 ` Eli Zaretskii
2022-04-20 19:01 ` Paul Eggert
2022-04-20 19:14 ` Eli Zaretskii
2022-04-20 19:14 ` Eli Zaretskii
2022-04-20 19:23 ` Paul Eggert
2022-04-20 19:30 ` Eli Zaretskii
2022-04-20 19:30 ` Eli Zaretskii
2022-04-21 0:11 ` Paul Eggert
2022-04-21 6:44 ` Eli Zaretskii
2022-04-21 6:44 ` Eli Zaretskii
2022-04-21 15:30 ` Max Nikulin
2022-04-21 15:58 ` Eli Zaretskii
2022-04-21 17:23 ` Max Nikulin
2022-04-21 18:46 ` Eli Zaretskii
2022-04-21 23:56 ` Paul Eggert
2022-04-21 23:56 ` Paul Eggert
2022-04-22 5:01 ` Eli Zaretskii
2022-04-22 5:01 ` Eli Zaretskii
2022-04-22 5:23 ` Time resolution in Emacs " Eli Zaretskii
2022-04-22 18:22 ` Paul Eggert
2022-04-22 18:52 ` Corwin Brust
2022-04-22 21:26 ` Paul Eggert
2022-04-23 6:27 ` Time resolution in Emacs Eli Zaretskii
2022-04-24 0:56 ` Paul Eggert
2022-04-24 6:10 ` Eli Zaretskii
2022-04-24 11:47 ` Max Nikulin
2022-04-24 12:23 ` Eli Zaretskii
2022-04-25 15:32 ` Paul Eggert
2022-04-25 16:01 ` Eli Zaretskii
2022-04-22 19:35 ` Time resolution in Emacs argument optional ones Eli Zaretskii
2022-04-22 21:52 ` Paul Eggert [this message]
2022-04-23 6:51 ` Time resolution in Emacs Eli Zaretskii
2022-04-25 15:34 ` Paul Eggert
2022-04-25 16:10 ` Eli Zaretskii
2022-04-25 16:38 ` Paul Eggert
2022-04-25 16:57 ` Eli Zaretskii
2022-04-25 16:54 ` Max Nikulin
2022-04-25 17:02 ` Eli Zaretskii
2022-04-25 19:27 ` Paul Eggert
2022-04-29 15:19 ` Max Nikulin
2022-04-29 16:07 ` Eli Zaretskii
2022-04-21 0:11 ` bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones Paul Eggert
2022-04-20 19:23 ` Paul Eggert
2022-04-20 19:01 ` Paul Eggert
2022-04-23 14:35 ` Bernhard Voelker
2022-04-23 14:35 ` Bernhard Voelker
2022-04-19 5:50 ` Eli Zaretskii
2022-04-20 15:07 ` Max Nikulin
2022-04-20 15:07 ` Max Nikulin
2022-04-20 18:29 ` Paul Eggert
2022-04-20 18:29 ` Paul Eggert
2022-04-25 15:30 ` Max Nikulin
2022-04-25 15:30 ` Max Nikulin
2022-04-25 15:37 ` Paul Eggert
2022-04-25 15:37 ` Paul Eggert
2022-04-25 19:49 ` Paul Eggert
2022-04-25 19:49 ` Paul Eggert
2022-04-30 11:22 ` Max Nikulin
2022-04-30 11:22 ` Max Nikulin
2022-05-01 2:32 ` Paul Eggert
2022-05-01 2:32 ` Paul Eggert
2022-05-01 17:15 ` Max Nikulin
2022-05-01 17:15 ` Max Nikulin
2022-04-14 22:46 ` Paul Eggert
2022-04-14 13:19 ` Max Nikulin
2022-04-13 15:12 ` Max Nikulin
2022-04-13 15:12 ` Max Nikulin
2022-04-16 16:26 ` Max Nikulin
2022-04-17 1:58 ` Paul Eggert
2022-04-17 1:58 ` Paul Eggert
2022-04-20 16:56 ` Max Nikulin
2022-04-20 16:56 ` Max Nikulin
2022-04-20 19:17 ` Paul Eggert
2022-04-20 19:17 ` Paul Eggert
2022-04-16 16:26 ` Max Nikulin
[not found] ` <handler.54764.D54764.165091617725815.notifdone@debbugs.gnu.org>
2022-04-25 21:16 ` Glenn Morris
2022-04-26 1:18 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9afbcc3d-b57c-b5bf-e4f6-52b352f99af8@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=manikulin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.