21 #ifndef SRC_INCLUDE_TSC_H_ 22 #define SRC_INCLUDE_TSC_H_ 29 #pragma intrinsic(__rdtsc) 67 asm volatile(
"xor %%eax,%%eax\n\tcpuid\n\trdtsc" 69 #elif defined _MSC_VER 79 asm volatile(
"xor %%eax,%%eax\n\tcpuid\n\trdtsc" 81 #elif defined _MSC_VER 85 asm volatile(
"rdtscp" :
"=a"(
m_end.
b[0]),
"=d"(
m_end.
b[1])::
"ecx");
95 #endif // SRC_INCLUDE_TSC_H_ A low-overhead timer for benchmarking small regions of code.
Union that stores cycles,.
void stop()
Stop the counter.
Data m_start
Stores start of benchmarking.
void start()
Start the counter.
Data m_end
Stores end of benchmarking.
unsigned int b[2]
Or two 32-bit integers.
uint64_t a
Either one 64-bit integer.
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
Convenience: dereferences the ActionPtr to Action.