1 // Copyright (c) 2016 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 /** Functions for measurement of CPU cycles */
13 static inline uint64_t perf_cpucycles(void)
16 __asm__
volatile (".byte 0x0f, 0x31" : "=A" (x
));
20 #elif defined(__x86_64__)
22 static inline uint64_t perf_cpucycles(void)
25 __asm__
__volatile__ ("rdtsc" : "=a"(lo
), "=d"(hi
));
26 return ((uint64_t)lo
)|(((uint64_t)hi
)<<32);
30 uint64_t perf_cpucycles(void);