Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/engine_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,15 @@ void fixed_memory_ptrs_shut() {

#if defined(__i386__) || defined(__x86_64__)
#include <x86intrin.h>
#elif defined(_POSIX_MONOTONIC_CLOCK)
#include <time.h>
int64_t __rdtsc() {
struct timespec tp = {0};
int64_t timestamp = 0;
if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
timestamp = tp.tv_sec * 1000000000 + tp.tv_nsec;
return timestamp;
}
#elif defined(__powerpc__) || defined(__ppc__)
#define __rdtsc() __builtin_ppc_mftb()
#else
Expand Down