Improve emulation speed.
This commit is contained in:
parent
5f3e1e314e
commit
dce1b0f4bb
1 changed files with 3 additions and 7 deletions
|
@ -684,11 +684,7 @@ void Sleep(int ms)
|
||||||
|
|
||||||
BOOL QueryPerformanceFrequency(PLARGE_INTEGER l) {
|
BOOL QueryPerformanceFrequency(PLARGE_INTEGER l) {
|
||||||
//https://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx
|
//https://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx
|
||||||
// static struct mach_timebase_info timebase = { 0, 0 };
|
l->QuadPart = 10000000;
|
||||||
// if (0 == timebase.denom)
|
|
||||||
// mach_timebase_info(&timebase);
|
|
||||||
//// l->LowPart = 1e9 * timebase.denom / timebase.numer;
|
|
||||||
l->QuadPart = 1000000;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -698,8 +694,8 @@ BOOL QueryPerformanceCounter(PLARGE_INTEGER l)
|
||||||
time_t tv_sec;
|
time_t tv_sec;
|
||||||
long tv_nsec;
|
long tv_nsec;
|
||||||
} */ time;
|
} */ time;
|
||||||
int result = clock_gettime(CLOCK_MONOTONIC, &time);
|
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||||
l->QuadPart = (uint64_t) ((1e9 * time.tv_sec + time.tv_nsec) / 1000);
|
l->QuadPart = (uint64_t) ((1e9 * time.tv_sec + time.tv_nsec) / 100);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
void InitializeCriticalSection(CRITICAL_SECTION * lpCriticalSection) {
|
void InitializeCriticalSection(CRITICAL_SECTION * lpCriticalSection) {
|
||||||
|
|
Loading…
Reference in a new issue