Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
a2d0b594
Unverified
Commit
a2d0b594
authored
Oct 05, 2018
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
7717b4c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
configure.ac
configure.ac
+1
-2
vtim.c
lib/libvarnish/vtim.c
+4
-4
No files found.
configure.ac
View file @
a2d0b594
...
...
@@ -355,7 +355,6 @@ AC_CHECK_FUNCS([clock_gettime])
AC_CHECK_FUNCS([gethrtime])
LIBS="${save_LIBS}"
AC_DEFINE([USE_GETHRTIME], [1], [whether to use gethrtime])
if test "x$ac_cv_func_gethrtime" = xyes && \
test "x$ac_cv_func_clock_gettime" = xyes ; then
AC_MSG_CHECKING(if clock_gettime is faster than gethrtime)
...
...
@@ -405,9 +404,9 @@ static hrtime_t cl()
return (1);
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([USE_GETHRTIME], [0], [whether to use gethrtime])
],
[AC_MSG_RESULT(no)
AC_DEFINE([USE_GETHRTIME], [1], [Define if gethrtime is preferred])
]
)
fi
...
...
lib/libvarnish/vtim.c
View file @
a2d0b594
...
...
@@ -127,14 +127,14 @@ init(void)
double
VTIM_mono
(
void
)
{
#if defined(HAVE_GETHRTIME) && USE_GETHRTIME
return
(
gethrtime
()
*
1e-9
);
#elif HAVE_CLOCK_GETTIME
#if defined(HAVE_CLOCK_GETTIME) && !defined(USE_GETHRTIME)
struct
timespec
ts
;
AZ
(
clock_gettime
(
CLOCK_MONOTONIC
,
&
ts
));
return
(
ts
.
tv_sec
+
1e-9
*
ts
.
tv_nsec
);
#elif defined(__MACH__)
#elif defined(HAVE_GETHRTIME)
return
(
gethrtime
()
*
1e-9
);
#elif defined(__MACH__)
uint64_t
mt
=
mach_absolute_time
()
-
mt_base
;
return
(
mt
*
mt_scale
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment