Update timing header so it works with C code
This commit is contained in:
@@ -38,7 +38,9 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define rdtsc __rdtsc
|
#define rdtsc __rdtsc
|
||||||
#else
|
#else
|
||||||
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#endif /* __cplusplus */
|
||||||
__inline__ uint64_t rdtsc() {
|
__inline__ uint64_t rdtsc() {
|
||||||
uint32_t low, high;
|
uint32_t low, high;
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
@@ -48,7 +50,9 @@ extern "C" {
|
|||||||
"rdtsc" : "=a" (low), "=d" (high));
|
"rdtsc" : "=a" (low), "=d" (high));
|
||||||
return (uint64_t)high << 32 | low;
|
return (uint64_t)high << 32 | low;
|
||||||
}
|
}
|
||||||
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
#endif /* __cplusplus */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uint64_t start, end;
|
static uint64_t start, end;
|
||||||
|
|||||||
Reference in New Issue
Block a user