1
0
Fork 0
forked from fte/fteqw

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4717 fc73d0e0-1445-4013-8a0c-d673dee63da5

This commit is contained in:
Spoike 2014-08-03 15:19:12 +00:00
parent 66aa41adef
commit 1f9daedabe

View file

@ -463,7 +463,7 @@ pbool PDECL ED_ParseEval (pubprogfuncs_t *progfuncs, eval_t *eval, int type, con
} }
#endif #endif
#if !defined(Sys_GetClock) && defined(__unix__) #if 0//!defined(Sys_GetClock) && defined(__unix__)
//linux/unix has some annoying abstraction and shows time in nanoseconds rather than cycles. lets hope we don't waste too much time reading it. //linux/unix has some annoying abstraction and shows time in nanoseconds rather than cycles. lets hope we don't waste too much time reading it.
#include <unistd.h> #include <unistd.h>
#if defined(_POSIX_TIMERS) && _POSIX_TIMERS >= 0 #if defined(_POSIX_TIMERS) && _POSIX_TIMERS >= 0
@ -483,6 +483,18 @@ pbool PDECL ED_ParseEval (pubprogfuncs_t *progfuncs, eval_t *eval, int type, con
#endif #endif
#endif #endif
#if !defined(Sys_GetClock) && defined(__unix__)
#include <time.h>
static unsigned long long Sys_GetClock(void)
{
return clock();
}
static unsigned long long Sys_GetClockRate(void)
{
return CLOCKS_PER_SEC;
}
#endif
#ifndef Sys_GetClock #ifndef Sys_GetClock
//other systems have no choice but to omit this feature in some way. this is just for profiling, so we can get away with stubs. //other systems have no choice but to omit this feature in some way. this is just for profiling, so we can get away with stubs.
#define Sys_GetClock() 0 #define Sys_GetClock() 0