]> git.ipfire.org Git - thirdparty/bind9.git/commit
Add isc_time_now_hires function to get current time with high resolution
authorPatrick McLean <chutzpah@gentoo.org>
Sat, 20 Mar 2021 05:48:22 +0000 (22:48 -0700)
committerEvan Hunt <each@isc.org>
Sat, 20 Mar 2021 18:25:55 +0000 (11:25 -0700)
commitebced74b194be22a490b055ee9cd939a367c3150
tree5e58aaa3b0ac415ba8f451297b6d503d6963bcea
parentbee4ee931fe5831ed1719562306d0eeac58e9162
Add isc_time_now_hires function to get current time with high resolution

The current isc_time_now uses CLOCK_REALTIME_COARSE which only updates
on a timer tick. This clock is generally fine for millisecond accuracy,
but on servers with 100hz clocks, this clock is nowhere near accurate
enough for microsecond accuracy.

This commit adds a new isc_time_now_hires function that uses
CLOCK_REALTIME, which gives the current time, though it is somewhat
expensive to call. When microsecond accuracy is required, it may be
required to use extra resources for higher accuracy.
lib/isc/include/isc/util.h
lib/isc/tests/time_test.c
lib/isc/unix/include/isc/time.h
lib/isc/unix/time.c
lib/isc/win32/include/isc/time.h
lib/isc/win32/libisc.def.in
lib/isc/win32/time.c