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

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: What is a typical precision of gettimeofday()?
Дата
Msg-id CAMT0RQQ=2u5GATAMWqnfsW7baTZT_6QgRVrZXd8oFS8bk1kVbQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: What is a typical precision of gettimeofday()?  ("Andrey M. Borodin" <x4mmm@yandex-team.ru>)
Ответы Re: What is a typical precision of gettimeofday()?
Список pgsql-hackers
I plan to send patch to pg_test_timing in a day or two 

the underlying time precision on modern linux seems to be

2 ns for some Intel CPUs
10 ns for Zen4
40 ns for ARM (Ampere)

---
Hannu



|


 

On Tue, Jun 18, 2024 at 7:48 AM Andrey M. Borodin <x4mmm@yandex-team.ru> wrote:


> 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 we can 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 measure nanoseconds) 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 по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: consider -Wmissing-variable-declarations
Следующее
От: Ashutosh Sharma
Дата:
Сообщение: Re: Truncation of mapped catalogs (whether local or shared) leads to server crash