2 // This file is part of the PicoDrive Megadrive Emulator
\r
4 // This code is licensed under the GNU General Public License version 2.0 and the MAME License.
\r
5 // You can choose the license that has the most advantages for you.
\r
7 // SVN repository can be found at http://code.google.com/p/cyclone68000/
\r
13 #pragma warning(disable:4514)
\r
14 #pragma warning(push)
\r
15 #pragma warning(disable:4201)
\r
16 #include <windows.h>
\r
17 #pragma warning(pop)
\r
19 static float Period=0.0f;
\r
20 static LARGE_INTEGER TimeStart={0,0};
\r
24 LARGE_INTEGER freq={0,0};
\r
26 QueryPerformanceFrequency(&freq);
\r
28 Period =(float)freq.HighPart*4294967296.0f;
\r
29 Period+=(float)freq.LowPart;
\r
31 if (Period>=1.0f) Period=1.0f/Period;
\r
37 QueryPerformanceCounter(&TimeStart);
\r
44 LARGE_INTEGER end={0,0};
\r
48 QueryPerformanceCounter(&end);
\r
50 ticks=end.LowPart-TimeStart.LowPart;
\r
51 seconds=(float)ticks*Period;
\r