Re: What is a typical precision of gettimeofday()?

Andrey Borodin <x4mmm@yandex-team.ru>

From: "Andrey M. Borodin" <x4mmm@yandex-team.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Hannu Krosing <hannuk@google.com>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-11-02T08:37:26Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Force LC_NUMERIC to C while running TAP tests.

  2. Minor tweaks for pg_test_timing.

  3. Change pg_test_timing to measure in nanoseconds not microseconds.


> On 2 Jul 2024, at 20:55, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Here's a cleaned-up code patch addressing the cfbot complaints
> and making the output logic a bit neater.
> 
> I think this is committable code-wise, but the documentation needs
> work, if not indeed a complete rewrite.  The examples are now
> horribly out of date, and it seems that the "Clock Hardware and Timing
> Accuracy" section is quite obsolete as well, since it suggests that
> the best available accuracy is ~100ns.
> 
> TBH I'm inclined to rip most of the OS-specific and hardware-specific
> information out of there, as it's not something we're likely to
> maintain well even if we got it right for current reality.

Hi Tom!

This thread has associated CF entry which is marked as RwF [0]. But the change proved to be useful [1] in understanding what we can expect from time source.
It was requested many times before [2,3]. Reading through this thread it seems to me that my questions about application of the pg_test_timing somehow switched focus from this patch. However, I'd appreciate if it was applied. Nanoseconds seem important to me.
Let me know if I can help in any way. Thanks!


Best regards, Andrey Borodin.

[0] https://commitfest.postgresql.org/48/5066/
[1] https://www.postgresql.org/message-id/CAD21AoC4iAr7M_OgtHA0HZMezot68_0vwUCQjjXKk2iW89w0Jg@mail.gmail.com
[2] https://www.postgresql.org/message-id/CAMT0RQQJWNoki_vmckYb5J1j-BENBE0YtD6jJmVg--Hyvt7Wjg%40mail.gmail.com
[3] https://www.postgresql.org/message-id/flat/198ef658-a5b7-9862-2017-faf85d59e3a8%40gmail.com#37d8292e93ec34407a41e7cbf56e5481