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

Hannu Krosing <hannuk@google.com>

From: Hannu Krosing <hannuk@google.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "Andrey M. Borodin" <x4mmm@yandex-team.ru>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-07-03T10:31:27Z
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 Wed, Jul 3, 2024 at 10:03 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Keep in mind also that instr_time.h does not pretend to provide
> real time --- the clock origin is arbitrary.  But these results
> do give me additional confidence that gettimeofday() should be
> good to the microsecond on any remotely-modern platform.

The only platform I have found where the resolution is only a
microsecond is RISC-V ( https://www.sifive.com/boards/hifive-unmatched
)

Everywhere else it seems to be much more precise.

--
Hannu