add option to use clock_gettime() in perf example
This is done to support architectures where `rdtsc()` is not implemented. In case it is available use `clock_gettime()`. Otherwise still fall back to use `clock()`. The first approach was to always use `clock_gettime()` if it is available but the overhead it brings compared to `rdtsc()` is high, so I chose to only try to use it if `rdtsc()` is not implemented. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
@@ -86,6 +86,7 @@ AX_VALGRIND_DFLT([helgrind], [off])
|
||||
AX_VALGRIND_DFLT([sgcheck], [off])
|
||||
AX_VALGRIND_CHECK
|
||||
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt], AC_DEFINE(HAVE_CLOCK_GETTIME,1))
|
||||
AC_SEARCH_LIBS([socket], [network socket])
|
||||
AC_CHECK_FUNCS([snprintf vsnprintf], [], [have_snprintf=no])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user