mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
GetClockTicks() - keep other arch in mind
This commit is contained in:
parent
65f7a305c1
commit
4cd232ca20
1 changed files with 9 additions and 3 deletions
|
@ -261,14 +261,20 @@ double Sys_GetClockTicks()
|
|||
"pop %%ebx\n"
|
||||
: "=r"( lo ), "=r"( hi ) );
|
||||
return ( double ) lo + ( double ) 0xFFFFFFFF * hi;
|
||||
#else
|
||||
//#error unsupported CPU
|
||||
// RB begin
|
||||
#elif defined( __x86_64__ )
|
||||
uint32_t lo, hi;
|
||||
__asm__ __volatile__ ( "rdtsc" : "=a" (lo), "=d" (hi));
|
||||
return ( ( ( uint64_t )hi ) << 32 ) | lo;
|
||||
// RB end
|
||||
#else
|
||||
//#error unsupported CPU
|
||||
struct timespec now;
|
||||
|
||||
clock_gettime( CLOCK_MONOTONIC, &now );
|
||||
|
||||
return now.tv_sec * 1000000000LL + now.tv_nsec;
|
||||
#endif
|
||||
// RB end
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue