|
|
1.1 root 1: /*
2: Hatari
3:
4: Debug Timer functions
5: */
6:
7: #include "main.h"
8:
9: #define LARGE_INTEGER long long /* ???? */
10: #define LONGLONG long long /* ???? */
11:
12: #define QueryPerformanceFrequency(x) /* FIXME: What the !$*? is this? */
13: #define QueryPerformanceCounter(x) /* Dito */
14:
15:
16: LARGE_INTEGER StartCount,EndCount,Frequency;
17:
1.1.1.2 ! root 18:
! 19: /*-----------------------------------------------------------------------*/
1.1 root 20: /*
21: Initialise debug timer
22: */
23: void Timer_Init(void)
24: {
25: #ifdef FIND_PERFORMANCE
1.1.1.2 ! root 26: /* Find frequency to calculate 'milli-second' results */
1.1 root 27: QueryPerformanceFrequency(&Frequency);
28: #endif
29: }
30:
1.1.1.2 ! root 31:
! 32: /*-----------------------------------------------------------------------*/
1.1 root 33: /*
34: Start timer
35: */
36: void Timer_Start()
37: {
1.1.1.2 ! root 38: /* Start timer */
1.1 root 39: QueryPerformanceCounter(&StartCount);
40: }
41:
1.1.1.2 ! root 42:
! 43: /*-----------------------------------------------------------------------*/
1.1 root 44: /*
45: Stop timer, return as 'milli-second' count(float)
46: */
47: float Timer_Stop()
48: {
49: LONGLONG a,b;
50:
1.1.1.2 ! root 51: /* End timer */
1.1 root 52: QueryPerformanceCounter(&EndCount);
53:
1.1.1.2 ! root 54: /* Find time and frequency */
1.1 root 55: a = EndCount /*.QuadPart*/ - StartCount /*.QuadPart*/; /* FIXME */
56: b = Frequency /*.QuadPart*/ ;
57:
58: return( ((float)a/(float)b) * 1000.0f ); /* as 'ms' */
59: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.