Re: What is a typical precision of gettimeofday()? - Mailing list pgsql-hackers

From Andrey M. Borodin
Subject Re: What is a typical precision of gettimeofday()?
Date
Msg-id 47AEACEE-E5CC-40E4-8611-01F3A465AF16@yandex-team.ru
Whole thread Raw
In response to What is a typical precision of gettimeofday()?  (Peter Eisentraut <peter@eisentraut.org>)
Responses Re: What is a typical precision of gettimeofday()?
Re: What is a typical precision of gettimeofday()?
List pgsql-hackers

> On 19 Mar 2024, at 13:28, Peter Eisentraut <peter@eisentraut.org> wrote:
>
> I feel that we don't actually have any information about this portability concern.  Does anyone know what precision
wecan expect from gettimeofday()?  Can we expect the full microsecond precision usually? 

At PGConf.dev Hannu Krossing draw attention to pg_test_timing module. I’ve tried this module(slightly modified to
measurenanoseconds) on some systems, and everywhere I found ~100ns resolution (95% of ticks fall into 64ns and 128ns
buckets).

I’ll add cc Hannu, and also pg_test_timing module authors Ants ang Greg. Maybe they can add some context.


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Xact end leaves CurrentMemoryContext = TopMemoryContext
Next
From: Michael Paquier
Date:
Subject: Flush pgstats file during checkpoints