From 1f9daedabe6e64aa32f6670f22bae5edfa181372 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 3 Aug 2014 15:19:12 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4717 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/progsint.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/engine/qclib/progsint.h b/engine/qclib/progsint.h index 24ab55a9f..8ac40efd3 100644 --- a/engine/qclib/progsint.h +++ b/engine/qclib/progsint.h @@ -463,7 +463,7 @@ pbool PDECL ED_ParseEval (pubprogfuncs_t *progfuncs, eval_t *eval, int type, con } #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. #include #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 +#if !defined(Sys_GetClock) && defined(__unix__) + #include + static unsigned long long Sys_GetClock(void) + { + return clock(); + } + static unsigned long long Sys_GetClockRate(void) + { + return CLOCKS_PER_SEC; + } +#endif + #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. #define Sys_GetClock() 0