mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-16 12:16:33 +08:00
performance enhancement
use clock_gettime if there is no instruction to get cpu tick. It will take about 10% performance enhancement in AIX 7.1.
This commit is contained in:
parent
b031325996
commit
c5b528fdcd
@ -234,6 +234,8 @@ uint64_t zmq::clock_t::rdtsc ()
|
||||
asm("\tstck\t%0\n" : "=Q" (tsc) : : "cc");
|
||||
return(tsc);
|
||||
#else
|
||||
return 0;
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
return (uint64_t)(ts.tv_sec) * 1000000000 + ts.tv_nsec;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user