From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Max Nikulin Newsgroups: gmane.emacs.bugs,gmane.comp.lib.gnulib.bugs Subject: bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones Date: Fri, 22 Apr 2022 00:23:01 +0700 Message-ID: References: <5ed963b2-3fa8-48d8-627e-bc0571d15b43@gmail.com> <149de00f-115b-5367-414f-c7700ef8966b@cs.ucla.edu> <2dd15844-01b3-0144-740c-185ec8488a81@cs.ucla.edu> <4a23f3a4-fe8f-d396-49d8-10034803be63@gmail.com> <52fb10fb-892a-f273-3be8-28793f27e204@cs.ucla.edu> <5cd820d4-ae67-43d4-9e63-c284d51ff1e4@gmail.com> <83tuapvcxs.fsf@gnu.org> <6efc5d24-34a2-fd30-cd20-fe4ac3e48310@cs.ucla.edu> <83fsm8tdzl.fsf@gnu.org> <9e4781b2-2ffa-b1ce-09b4-ead82cad9038@cs.ucla.edu> <83ilr3siku.fsf@gnu.org> <4e41671c-fae8-61c4-845c-4c7ba4317e88@cs.ucla.edu> <83fsm7sh2s.fsf@gnu.org> <83czhbsgc2.fsf@gnu.org> <33fb24fb-282b-cc13-a597-e7b63f19982d@cs.ucla.edu> <83y1zzq6kd.fsf@gnu.org> <3fbed833-b568-9736-ebfd-b57bfb598f1a@gmail.com> <83levyqvhp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21082"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Cc: eggert@cs.ucla.edu, bug-gnulib@gnu.org, 54764@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 21 19:27:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nhaaN-0005JU-AX for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Apr 2022 19:27:19 +0200 Original-Received: from localhost ([::1]:34022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhaaM-0008NQ-7j for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Apr 2022 13:27:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhaXC-0002l3-6b for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2022 13:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56999) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhaXB-0001b4-UC for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2022 13:24:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nhaXB-0007gO-OI for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2022 13:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Max Nikulin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Apr 2022 17:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54764 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 54764-submit@debbugs.gnu.org id=B54764.165056179229462 (code B ref 54764); Thu, 21 Apr 2022 17:24:01 +0000 Original-Received: (at 54764) by debbugs.gnu.org; 21 Apr 2022 17:23:12 +0000 Original-Received: from localhost ([127.0.0.1]:50896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhaWO-0007f8-J3 for submit@debbugs.gnu.org; Thu, 21 Apr 2022 13:23:12 -0400 Original-Received: from mail-lj1-f174.google.com ([209.85.208.174]:46652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhaWL-0007er-Td for 54764@debbugs.gnu.org; Thu, 21 Apr 2022 13:23:10 -0400 Original-Received: by mail-lj1-f174.google.com with SMTP id bj36so6570585ljb.13 for <54764@debbugs.gnu.org>; Thu, 21 Apr 2022 10:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=jyvfzmIJWvQ+fmDBKguLDTRI1/Ffk6bO3iaMHNLJl4k=; b=UDBX28cJ07N9V6IU++2QcwbQLAeZI+kcDeCm5/fLfEWRRHC/CqOcTqIoIIlJQ/PMSy BwCYFDykHbBXJ2OsiYspT4W5WMTMr68VP2y9CA+GXqnSTQBclRfEfWHAqSz5hf0QxFyE 26b72IyqPsbq3Moq/Se7dtlGaeKz73fcN/DxnNJgC3qmzkhCQVvLDQw82D1OZ3uluaeC WdwaN6rTTVDbNidHNME30EUF11Q1XLD15WEwDJaFKnJ2rCOFdzZRnbyngZw0AfvKQbH4 2BI49pQy6g5RqIS9XDuDJPKjIrDKHJ8SEa/dQSPQKLg2i1Zz/M7kvDbJmgrQrbOm95El yeQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=jyvfzmIJWvQ+fmDBKguLDTRI1/Ffk6bO3iaMHNLJl4k=; b=CdxohfuklHk+TobNIWORLpr7F5nnagww2DwZp93AvYYim2DNRIdSI1GhSNlRB5YCyh PUrzz7DU9YbP88XY5RH8/jeGRWzRQ80jVsV/v0sBTC45BX4+he0cw9qreJjI3wRif95v WP9u5C+a5n4wJF7EZwddIdbi/5uuql6kRyjBNsvtUYgiHWb/B/ggW1Ra42OiAoGeeX2a 0b97iMHACSPcKC16PijR6/AicbB084Dyd2O+Vp9uYxe36/fSsG5CnYmfJior6Q9gRMk/ xAb4lgcwyCj4irN/LvKpTab8N5CbDpXyd6CuddrCd+uFIFgLz1i7Opj6WC0iLnvboSkP 7Rdg== X-Gm-Message-State: AOAM530qUL46eQpjNRrdq1c3M3Ba/fsTeA8tuLH8YvHbl9BQDoCRMnQ9 lXJUm+wXLcsMSAEezlmuC1I= X-Google-Smtp-Source: ABdhPJySkJJ5jlYCQgUh2SH+wrMkLBhNXJtobKKQmoKbIfsC4l4Q0Mlia28OzCz2eDVdiWcRsERWXQ== X-Received: by 2002:a2e:94c5:0:b0:24b:7029:75eb with SMTP id r5-20020a2e94c5000000b0024b702975ebmr440439ljh.506.1650561783398; Thu, 21 Apr 2022 10:23:03 -0700 (PDT) Original-Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id e3-20020a196903000000b00471930966cdsm1342680lfc.233.2022.04.21.10.23.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Apr 2022 10:23:02 -0700 (PDT) Content-Language: en-US In-Reply-To: <83levyqvhp.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:230389 gmane.comp.lib.gnulib.bugs:45811 Archived-At: On 21/04/2022 22:58, Eli Zaretskii wrote: >> Date: Thu, 21 Apr 2022 22:30:21 +0700 >> From: Max Nikulin >> >> Eli Zaretskii, Wed, 20 Apr 2022 22:30:21 >>> I see the time samples change in jumps of 15 msec. Which is expected >>> on MS-Windows, given the scheduler time tick, >> >> Why do you expect such value? > > It is a well-known fact that the system timer tick happens 64 times a > second on MS-Windows. You may notice similar coarse scheduler timer on Linux as well. General purpose PC nowadays may have higher scheduler frequency, but I saw a case when usleep(1) caused 20ms pause while there was no problem to get higher precision form system clock. >> 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. >> 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 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. > 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. It seems, only coarse clock is currently available in Emacs on Windows due to usage of current_timespec. Are there any known problem with 16ms resolution?