unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Max Nikulin <manikulin@gmail.com>
Cc: eggert@cs.ucla.edu, bug-gnulib@gnu.org, 54764@debbugs.gnu.org
Subject: bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones
Date: Thu, 21 Apr 2022 21:46:38 +0300	[thread overview]
Message-ID: <83ee1qqnox.fsf@gnu.org> (raw)
In-Reply-To: <f3b9dc57-fcfe-526e-1e55-97ea587f8802@gmail.com> (message from Max Nikulin on Fri, 22 Apr 2022 00:23:01 +0700)

> Date: Fri, 22 Apr 2022 00:23:01 +0700
> Cc: eggert@cs.ucla.edu, bug-gnulib@gnu.org, 54764@debbugs.gnu.org
> From: Max Nikulin <manikulin@gmail.com>
> 
> >> Clock resolution generally has a little common with timers.
> > 
> > I agree, but that's something you should tell/ask Paul, not myself.
> 
> It may be deeper, e.g. additional call during initialization or extra 
> privileges may be required.

No, that's not the case here.

> >> I have no experience with windows-specific code, but quick search gives
> >> GetSystemTimePreciseAsFileTime that should provide timestamps with fine
> >> granularity
> >> https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime
> > 
> > That API exists only since Windows 8.
> 
> I suspect that it means just that MS does not support anything prior to 
> Windows 8 any more. XP is mentioned in connection to this function: 
> https://www.lochan.org/2005/keith-cl/useful/win32time.html

It doesn't matter to us, because we do support older versions.

> Writing about possible intentional hiding of high precision clock I was 
> assuming latest windows versions, I believe, even Windows 8 is too old 
> for such modern tricks.

There's no problem having high-resolution time stamps in Emacs on all
versions of Windows since Windows 2000, but before we implement
something like that, we should understand the goal and the effects on
Lisp programs.  Which is why I asked Paul questions that need to be
answered before we talk about the implementation.

> > More importantly the Gnulib
> > implementation of current_timespec doesn't use it.
> 
> Even if it is not used yet, is it intentional design decision or just an 
> issue that should be fixed? I am unsure what function 
> clock_gettime/timespec_get/gettimeofday is actually used on windows 
> platform and how it is implemented.

We use gettimeofdate, because the more modern clock_gettime requires
linking against pthreads in the MinGW64 builds, and we don't want that
additional dependency.  But since clock_gettime produces the same
15.6 msec granularity, we don't lose anything by using a slightly
older interface.

> It seems, only coarse clock is currently available in Emacs on Windows 
> due to usage of current_timespec.

Yes.

> Are there any known problem with 16ms resolution?

Not that I know of, but please wait for the discussion with Paul to
come to its conclusion.





  reply	other threads:[~2022-04-21 18:46 UTC|newest]

Thread overview: 45+ 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
     [not found] ` <149de00f-115b-5367-414f-c7700ef8966b@cs.ucla.edu>
2022-04-09 11:36   ` Max Nikulin
2022-04-13 14:40   ` Max Nikulin
2022-04-13 18:35     ` Paul Eggert
2022-04-14 13:19       ` Max Nikulin
     [not found]       ` <4a23f3a4-fe8f-d396-49d8-10034803be63@gmail.com>
2022-04-14 22:46         ` Paul Eggert
     [not found]         ` <52fb10fb-892a-f273-3be8-28793f27e204@cs.ucla.edu>
2022-04-15  2:14           ` Tim Cross
2022-04-15 17:23           ` Max Nikulin
     [not found]           ` <5cd820d4-ae67-43d4-9e63-c284d51ff1e4@gmail.com>
2022-04-16 19:23             ` Paul Eggert
2022-04-19  2:02             ` Paul Eggert
2022-04-19  5:50               ` Eli Zaretskii
     [not found]               ` <83tuapvcxs.fsf@gnu.org>
2022-04-19 22:22                 ` Paul Eggert
2022-04-20  7:23                   ` Eli Zaretskii
     [not found]                   ` <83fsm8tdzl.fsf@gnu.org>
2022-04-20 18:19                     ` Paul Eggert
2022-04-20 18:41                       ` Eli Zaretskii
2022-04-20 19:01                         ` Paul Eggert
     [not found]                         ` <4e41671c-fae8-61c4-845c-4c7ba4317e88@cs.ucla.edu>
2022-04-20 19:14                           ` Eli Zaretskii
     [not found]                           ` <83fsm7sh2s.fsf@gnu.org>
2022-04-20 19:23                             ` Paul Eggert
     [not found]                             ` <e4cc58ca-51f9-395e-05f5-5f06cb9d439d@cs.ucla.edu>
2022-04-20 19:30                               ` Eli Zaretskii
2022-04-21  0:11                                 ` Paul Eggert
     [not found]                                 ` <33fb24fb-282b-cc13-a597-e7b63f19982d@cs.ucla.edu>
2022-04-21  6:44                                   ` Eli Zaretskii
     [not found]                                   ` <83y1zzq6kd.fsf@gnu.org>
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 [this message]
2022-04-21 23:56                                     ` Paul Eggert
     [not found]                                     ` <aa2bc0a0-1bec-37ff-919d-c20fcdfdab68@cs.ucla.edu>
2022-04-22  5:01                                       ` Eli Zaretskii
2022-04-23 14:35                       ` Bernhard Voelker
2022-04-20 15:07               ` Max Nikulin
     [not found]               ` <25d90a4b-f47d-01b4-2bfe-9951e97fe676@gmail.com>
2022-04-20 18:29                 ` Paul Eggert
2022-04-25 15:30                   ` Max Nikulin
2022-04-25 15:37                     ` Paul Eggert
     [not found]                     ` <4bd57f21-0660-fce0-d796-08c534402340@cs.ucla.edu>
2022-04-25 19:49                       ` Paul Eggert
2022-04-30 11:22                         ` Max Nikulin
2022-05-01  2:32                           ` Paul Eggert
2022-05-01 17:15                             ` Max Nikulin
     [not found]             ` <507cc0a2-d2d9-4283-7cc2-0da3c6510ac8@cs.ucla.edu>
2022-04-21 16:59               ` Max Nikulin
2022-04-13 15:12   ` Max Nikulin
2022-04-16 16:26   ` Max Nikulin
     [not found]   ` <2d57e59b-f971-483b-ad65-e0c5ff7883e8@gmail.com>
2022-04-17  1:58     ` Paul Eggert
     [not found]     ` <3624beb8-71fd-924e-a065-74d0034ed351@cs.ucla.edu>
2022-04-20 16:56       ` Max Nikulin
2022-04-20 19:17         ` Paul Eggert
     [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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ee1qqnox.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=54764@debbugs.gnu.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --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 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).