equal
deleted
inserted
replaced
21 #include "../waypoint.h" |
21 #include "../waypoint.h" |
22 #include "../debug.h" |
22 #include "../debug.h" |
23 #include "../settings_type.h" |
23 #include "../settings_type.h" |
24 #include "../tunnelbridge.h" |
24 #include "../tunnelbridge.h" |
25 |
25 |
26 extern uint64 _rdtsc(); |
26 extern uint64 ottd_rdtsc(); |
27 |
27 |
28 #include <limits.h> |
28 #include <limits.h> |
29 #include <new> |
29 #include <new> |
30 |
30 |
31 #if defined(_WIN32) || defined(_WIN64) |
31 #if defined(_WIN32) || defined(_WIN64) |
43 |
43 |
44 FORCEINLINE void Start() {m_start = QueryTime();} |
44 FORCEINLINE void Start() {m_start = QueryTime();} |
45 FORCEINLINE void Stop() {m_acc += QueryTime() - m_start;} |
45 FORCEINLINE void Stop() {m_acc += QueryTime() - m_start;} |
46 FORCEINLINE int Get(int64 coef) {return (int)(m_acc * coef / QueryFrequency());} |
46 FORCEINLINE int Get(int64 coef) {return (int)(m_acc * coef / QueryFrequency());} |
47 |
47 |
48 FORCEINLINE int64 QueryTime() {return _rdtsc();} |
48 FORCEINLINE int64 QueryTime() {return ottd_rdtsc();} |
49 FORCEINLINE int64 QueryFrequency() {return ((int64)2200 * 1000000);} |
49 FORCEINLINE int64 QueryFrequency() {return ((int64)2200 * 1000000);} |
50 }; |
50 }; |
51 |
51 |
52 struct CPerfStartReal |
52 struct CPerfStartReal |
53 { |
53 { |