2 // This file is part of the PicoDrive Megadrive Emulator
\r
4 // Copyright (c) 2011 FinalDave (emudave (at) gmail.com)
\r
6 // This code is licensed under the GNU General Public License version 2.0 and the MAME License.
\r
7 // You can choose the license that has the most advantages for you.
\r
9 // SVN repository can be found at http://code.google.com/p/cyclone68000/
\r
11 #include "PicoInt.h"
\r
15 #pragma warning(disable:4514)
\r
16 #pragma warning(push)
\r
17 #pragma warning(disable:4201)
\r
18 #include <windows.h>
\r
19 #pragma warning(pop)
\r
21 static float Period=0.0f;
\r
22 static LARGE_INTEGER TimeStart={0,0};
\r
26 LARGE_INTEGER freq={0,0};
\r
28 QueryPerformanceFrequency(&freq);
\r
30 Period =(float)freq.HighPart*4294967296.0f;
\r
31 Period+=(float)freq.LowPart;
\r
33 if (Period>=1.0f) Period=1.0f/Period;
\r
39 QueryPerformanceCounter(&TimeStart);
\r
46 LARGE_INTEGER end={0,0};
\r
50 QueryPerformanceCounter(&end);
\r
52 ticks=end.LowPart-TimeStart.LowPart;
\r
53 seconds=(float)ticks*Period;
\r