Sample Header Ad - 728x90

Units of tick in struct timex

5 votes
0 answers
39 views
Linux header files and man pages for adjtimex(2) and ntp_adjtime(2) describe struct timex, containing a tick field that is described as the number of microseconds for each system clock tick. However, my Debian 10 and 12 systems have CONFIG_HZ=250, while ntp_adjtime(2) says that tick=10000, which would correspond to a clock rate of 100Hz, not 250Hz. This old-ish source says that in fact the adjtimex(2) and ntp_adjtime(2) tick value is an abstract value (mainly for use by NTP) that is the number of times an NTP abstract tick occurs in a day. This would resolve the conflict of an OS running with 250Hz clock ticks but having tick=10000. This tick=10000 would thus correspond to about 8.64 seconds. It looks like the struct time tick value was originally the number of microseconds in a clock tick; early papers from David Mills say that this was the rate (100Hz) that the Solaris machines he was using ticked their system clock. Are the units of struct timex's tick field now "number of ticks per day" or are they still number of microseconds per tick? If the latter, what ticks are being referenced, since clearly it does not correspond to the CONFIG_HZ value for my Linux kernels?
Asked by A Rooks (51 rep)
Jun 17, 2025, 06:17 PM