From 7788bac40c9a422a1081913f83b9b0328eca121c Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sat, 20 Nov 2010 03:24:51 +0000 Subject: Fix ogl screenshots for windows. Fix the macosx build (perhaps). This changes the JitIL timed profiling to using assembly language to obtain the time. It does seem to be faster. Not sure if it will work on macosx, but if it does it has the necessary precision that gettimeofday does not have. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6448 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Thread.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Source/Core/Common/Src/Thread.cpp') diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp index 2788a4583e..aeee52ca22 100644 --- a/Source/Core/Common/Src/Thread.cpp +++ b/Source/Core/Common/Src/Thread.cpp @@ -492,11 +492,16 @@ namespace Common if (timeout != INFINITE) { + memset(&wait, 0, sizeof(wait)); +#ifdef USE_GETTIMEOFDAY + struct timeval now; + gettimeofday(&now, NULL); + wait.tv_nsec = (now.tv_usec + (timeout % 1000)) * 1000; +#else struct timespec now; clock_gettime(CLOCK_MONOTONIC_RAW, &now); - - memset(&wait, 0, sizeof(wait)); wait.tv_nsec = now.tv_nsec + (timeout % 1000) * 1000000; +#endif wait.tv_sec = now.tv_sec + (timeout / 1000); } -- cgit v1.2.3