| // SwiftShader Software Renderer |
| // Copyright(c) 2005-2012 TransGaming Inc. |
| // All rights reserved. No part of this software may be copied, distributed, transmitted, |
| // transcribed, stored in a retrieval system, translated into any human or computer |
| // language by any means, or disclosed to third parties without the explicit written |
| // agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express |
| // or implied, including but not limited to any patent rights, are granted to you. |
| #ifndef WIN32_LEAN_AND_MEAN |
| #define WIN32_LEAN_AND_MEAN |
| return (double)counter() / (double)frequency(); |
| return (double)t.tv_sec + (double)t.tv_usec * 1.0e-6; |
| __asm volatile("rdtsc": "=A" (tsc)); |
| QueryPerformanceCounter((LARGE_INTEGER*)&counter); |
| return t.tv_sec * 1000000 + t.tv_usec; |
| int64_t Timer::frequency() |
| QueryPerformanceFrequency((LARGE_INTEGER*)&frequency); |
| return 1000000; // gettimeofday uses microsecond resolution |