Commit c5b528fd authored by Laughing's avatar Laughing Committed by GitHub

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.
parent b0313259
...@@ -234,6 +234,8 @@ uint64_t zmq::clock_t::rdtsc () ...@@ -234,6 +234,8 @@ uint64_t zmq::clock_t::rdtsc ()
asm("\tstck\t%0\n" : "=Q" (tsc) : : "cc"); asm("\tstck\t%0\n" : "=Q" (tsc) : : "cc");
return(tsc); return(tsc);
#else #else
return 0; struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (uint64_t)(ts.tv_sec) * 1000000000 + ts.tv_nsec;
#endif #endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment