What is a typical precision of gettimeofday()?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема What is a typical precision of gettimeofday()?
Дата
Msg-id be0339cc-1ae1-4892-9445-8e6d8995a44d@eisentraut.org
обсуждение исходный текст
Ответы Re: What is a typical precision of gettimeofday()?
Список pgsql-hackers
Over in the thread discussing the addition of UUIDv7 support [0], there 
is some uncertainty about what timestamp precision one can expect from 
gettimeofday().

UUIDv7 uses milliseconds since Unix epoch, but can optionally use up to 
12 additional bits of timestamp precision (see [1]), but it can also 
just use a counter instead of the extra precision.  The current patch 
uses the counter method "because of portability concerns" (source code 
comment).

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?


[0]: 
https://www.postgresql.org/message-id/flat/CAAhFRxitJv=yoGnXUgeLB_O+M7J2BJAmb5jqAT9gZ3bij3uLDA@mail.gmail.com
[1]: 
https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#section-6.2-5.6.1



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: A problem about partitionwise join
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: UUID v7