mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-29 17:39:09 +00:00
(svn r6411) -Fix(r6410): forgot to update openttd*.sln (thx Darkvater and michi_cc :) )
-Cleanup: Removed UNITTEST preprocessor checks
This commit is contained in:
@@ -49,28 +49,8 @@ struct CPerformanceTimer
|
||||
FORCEINLINE void Stop() {m_acc += QueryTime() - m_start;}
|
||||
FORCEINLINE int Get(int64 coef) {return (int)(m_acc * coef / QueryFrequency());}
|
||||
|
||||
#if !defined(UNITTEST) && 1
|
||||
FORCEINLINE int64 QueryTime() {return _rdtsc();}
|
||||
FORCEINLINE int64 QueryFrequency() {return ((int64)2200 * 1000000);}
|
||||
#elif defined(_WIN32) || defined(_WIN64)
|
||||
FORCEINLINE int64 QueryTime() {LARGE_INTEGER c; QueryPerformanceCounter(&c); return c.QuadPart;}
|
||||
FORCEINLINE int64 QueryFrequency() {LARGE_INTEGER f; QueryPerformanceFrequency(&f); return f.QuadPart;}
|
||||
#elif defined(CLOCK_THREAD_CPUTIME_ID)
|
||||
FORCEINLINE int64 QueryTime()
|
||||
{
|
||||
timespec ts;
|
||||
int ret = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
|
||||
if (ret != 0) return 0;
|
||||
return (ts.tv_sec * 1000000000LL) + ts.tv_nsec;
|
||||
}
|
||||
FORCEINLINE int64 QueryFrequency()
|
||||
{
|
||||
return 1000000000;
|
||||
}
|
||||
#else
|
||||
int64 QueryTime() {return 0;}
|
||||
int64 QueryFrequency() {return 1;}
|
||||
#endif
|
||||
};
|
||||
|
||||
struct CPerfStartReal
|
||||
|
Reference in New Issue
Block a user