diff options
| author | Glenn Rice <glennricster@gmail.com> | 2010-11-20 03:24:51 +0000 |
|---|---|---|
| committer | Glenn Rice <glennricster@gmail.com> | 2010-11-20 03:24:51 +0000 |
| commit | 7788bac40c9a422a1081913f83b9b0328eca121c (patch) | |
| tree | 46e83d5e446f48de9b536f31571e9ba74a51dee0 /Source/Core/Common/Src/Thread.cpp | |
| parent | ef55177ed6a6509d725cae39739c1bd68e6c4b30 (diff) | |
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
Diffstat (limited to 'Source/Core/Common/Src/Thread.cpp')
| -rw-r--r-- | Source/Core/Common/Src/Thread.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
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); } |
