15eb0001 |
1 | \r |
2 | #include "PicoInt.h"\r |
3 | \r |
4 | #ifdef _WIN32_WCE\r |
5 | \r |
6 | #pragma warning(disable:4514)\r |
7 | #pragma warning(push)\r |
8 | #pragma warning(disable:4201)\r |
9 | #include <windows.h>\r |
10 | #pragma warning(pop)\r |
11 | \r |
12 | static float Period=0.0f;\r |
13 | static LARGE_INTEGER TimeStart={0,0};\r |
14 | \r |
15 | int ProfileInit()\r |
16 | {\r |
17 | LARGE_INTEGER freq={0,0};\r |
18 | \r |
19 | QueryPerformanceFrequency(&freq);\r |
20 | \r |
21 | Period =(float)freq.HighPart*4294967296.0f;\r |
22 | Period+=(float)freq.LowPart;\r |
23 | \r |
24 | if (Period>=1.0f) Period=1.0f/Period;\r |
25 | return 0;\r |
26 | }\r |
27 | \r |
28 | int ProfileStart()\r |
29 | {\r |
30 | QueryPerformanceCounter(&TimeStart);\r |
31 | \r |
32 | return 0;\r |
33 | }\r |
34 | \r |
35 | float ProfileTime()\r |
36 | {\r |
37 | LARGE_INTEGER end={0,0};\r |
38 | int ticks=0;\r |
39 | float seconds=0.0f;\r |
40 | \r |
41 | QueryPerformanceCounter(&end);\r |
42 | \r |
43 | ticks=end.LowPart-TimeStart.LowPart;\r |
44 | seconds=(float)ticks*Period;\r |
45 | \r |
46 | return seconds;\r |
47 | }\r |
48 | \r |
49 | #endif\r |
50 | \r |