Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
c90f54e6
Commit
c90f54e6
authored
Dec 11, 2011
by
Martin Lucina
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:zeromq/libzmq
parents
b4f5ee58
e7d748e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
AUTHORS
AUTHORS
+1
-0
configure.in
configure.in
+3
-2
clock.cpp
src/clock.cpp
+12
-0
No files found.
AUTHORS
View file @
c90f54e6
...
...
@@ -48,6 +48,7 @@ Matus Hamorsky <mhamorsky@gmail.com>
Max Wolf <YIDIEPXGXGPN@spammotel.com>
McClain Looney <m@loonsoft.com>
Michael Compton <michael.compton@littleedge.co.uk>
Mika Fischer <mika.fischer@zoopnet.de>
Mikael Helbo Kjaer <mhk@designtech.dk>
Mikko Koppanen <mkoppanen@php.net>
Min Ragan-Kelley <benjaminrk@gmail.com>
...
...
configure.in
View file @
c90f54e6
...
...
@@ -64,6 +64,7 @@ LIBZMQ_WITH_GCOV
# Checks for libraries.
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([rt], [clock_gettime])
# Set pedantic
libzmq_pedantic="yes"
...
...
@@ -238,7 +239,7 @@ LIBZMQ_CHECK_POLLER([CPPFLAGS="${CPPFLAGS} -D${libzmq_cv_poller_flag}"],
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(errno.h arpa/inet.h netinet/tcp.h netinet/in.h stddef.h \
stdlib.h string.h sys/socket.h sys/time.h unistd.h limits.h)
stdlib.h string.h sys/socket.h sys/time.h
time.h
unistd.h limits.h)
# Check if we have ifaddrs.h header file.
AC_CHECK_HEADERS(ifaddrs.h, [AC_DEFINE(ZMQ_HAVE_IFADDRS, 1, [Have ifaddrs.h header.])])
...
...
@@ -370,7 +371,7 @@ AM_CONDITIONAL(ON_MINGW, test "x$libzmq_on_mingw32" = "xyes")
# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(perror gettimeofday memset socket getifaddrs freeifaddrs)
AC_CHECK_FUNCS(perror gettimeofday
clock_gettime
memset socket getifaddrs freeifaddrs)
AC_CHECK_HEADERS([alloca.h])
LIBZMQ_CHECK_SOCK_CLOEXEC([AC_DEFINE(
[ZMQ_HAVE_SOCK_CLOEXEC],
...
...
src/clock.cpp
View file @
c90f54e6
...
...
@@ -34,6 +34,10 @@
#include <sys/time.h>
#endif
#if defined HAVE_CLOCK_GETTIME
#include <time.h>
#endif
zmq
::
clock_t
::
clock_t
()
:
last_tsc
(
rdtsc
()),
last_time
(
now_us
()
/
1000
)
...
...
@@ -61,6 +65,14 @@ uint64_t zmq::clock_t::now_us ()
double
ticks_div
=
(
double
)
(
ticksPerSecond
.
QuadPart
/
1000000
);
return
(
uint64_t
)
(
tick
.
QuadPart
/
ticks_div
);
#elif defined HAVE_CLOCK_GETTIME
// Use POSIX clock_gettime function to get precise monotonic time.
struct
timespec
tv
;
int
rc
=
clock_gettime
(
CLOCK_MONOTONIC
,
&
tv
);
errno_assert
(
rc
==
0
);
return
(
tv
.
tv_sec
*
(
uint64_t
)
1000000
+
tv
.
tv_nsec
/
1000
);
#else
// Use POSIX gettimeofday function to get precise time.
...
...
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