emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Time resolution in Emacs


From: Paul Eggert
Subject: Re: Time resolution in Emacs
Date: Mon, 25 Apr 2022 09:38:00 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 4/25/22 09:10, Eli Zaretskii wrote:
What do you do if you get a timestamp whose
fractional part looks like .123000 -- do you consider this to be
millisecond resolution or microsecond resolution?

The latter. That's standard practice, pretty much everywhere.


we'd
get in trouble as result of trivial arithmetics on timestamps

Whatever trouble we get into, will be less trouble than we get with arbitrarily converting to a resolution that differs from that of the incoming timestamp.

More generally, we can't do a perfect job with timestamp resolution, but that's OK. There's never perfection in timestamps anyway. What we can do, is do a better job than what we're currently doing.


It's very hard to keep only that many significant digits when working
with fractional numbers.

It's not hard to send a textual timestamp. Emacs does this sort of thing routinely when printing floats, and fractions are easier than floats. And Emacs code that computes timestamps internally can continue to use whatever resolution it is currently using; it doesn't need to arbitrary limit that resolution.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]