license info added to Pico directory
[cyclone68000.git] / Pico / Profile.cpp
CommitLineData
15eb0001 1\r
4abeeb4b 2// This file is part of the PicoDrive Megadrive Emulator\r
3\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
6\r
7// SVN repository can be found at http://code.google.com/p/cyclone68000/\r
8\r
15eb0001 9#include "PicoInt.h"\r
10\r
11#ifdef _WIN32_WCE\r
12\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
18\r
19static float Period=0.0f;\r
20static LARGE_INTEGER TimeStart={0,0};\r
21\r
22int ProfileInit()\r
23{\r
24 LARGE_INTEGER freq={0,0};\r
25\r
26 QueryPerformanceFrequency(&freq);\r
27\r
28 Period =(float)freq.HighPart*4294967296.0f;\r
29 Period+=(float)freq.LowPart;\r
30\r
31 if (Period>=1.0f) Period=1.0f/Period;\r
32 return 0;\r
33}\r
34\r
35int ProfileStart()\r
36{\r
37 QueryPerformanceCounter(&TimeStart);\r
38\r
39 return 0;\r
40}\r
41\r
42float ProfileTime()\r
43{\r
44 LARGE_INTEGER end={0,0};\r
45 int ticks=0;\r
46 float seconds=0.0f;\r
47\r
48 QueryPerformanceCounter(&end);\r
49\r
50 ticks=end.LowPart-TimeStart.LowPart;\r
51 seconds=(float)ticks*Period;\r
52\r
53 return seconds;\r
54}\r
55\r
56#endif\r
57\r