-
Notifications
You must be signed in to change notification settings - Fork 0
/
timecntr.cpp
87 lines (56 loc) · 1.22 KB
/
timecntr.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Filename: TimeCntr.cpp
//
// Developed by Oliver Belaifa in 1997
//
#include<stdlib.h>
#include<time.h>
#include<timecntr.h>
//extern "C"
//{
// int GetTimeStampCounterPosASM();
//}
void CTimeCounter::StartTimeCounter()
{
// m_iStartRDTSC = GetTimeStampCounterPosASM();
}
void CTimeCounter::StopTimeCounter()
{
// m_iStopRDTSC = GetTimeStampCounterPosASM();
}
float CTimeCounter::GetFPS()
{
// return (float)m_iCPUSpeed/((float)(m_iStopRDTSC - m_iStartRDTSC));
return 1.0;
}
int CTimeCounter::GetTSC()
{
// return m_iStopRDTSC - m_iStartRDTSC;
return 1;
}
void CTimeCounter::Init()
{
/*
int iCurTimePos = (int)clock();
while(iCurTimePos == (int)clock());
int iStartRDTSC = GetTimeStampCounterPosASM();
iCurTimePos = (int)clock();
while (iCurTimePos == (int)clock());
// iWaitTime ms warten
int iStopRDTSC = GetTimeStampCounterPosASM();
float fCPUSpeed = (float)(iStopRDTSC - iStartRDTSC);
fCPUSpeed *= 18.29;
*/
m_iCPUSpeed = 200000000;//(int)fCPUSpeed;
}
void CTimeCounter::Free()
{
}
CTimeCounter::CTimeCounter()
{
m_iCPUSpeed = 0;
m_iStartRDTSC = 0;
m_iStopRDTSC = 0;
}
CTimeCounter::~CTimeCounter()
{
}