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

Laurenz Albe <laurenz.albe@cybertec.at>

From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>, Hannu Krosing <hannuk@google.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-07-09T06:42:46Z
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 Tue, 2025-07-08 at 18:17 -0400, Tom Lane wrote:
> One other thing that bothers me as I look at the output is
> 
> 	Per loop time including overhead: 731.26 ns
> 
> That's stated in a way that makes it sound like that is a
> very solid number, when in fact it's just the average.
> We see from these test cases that there are frequently
> a few outliers that are far from the average.  I'm tempted
> to rephrase as
> 
> 	Average loop time including overhead: 731.26 ns
> 
> or some variant of that.  Thoughts?

I think that is a good idea.

Yours,
Laurenz Albe