MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / startHighResolutionTimer

Function startHighResolutionTimer

Engine/source/platform/profiler.cpp:74–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 __asm
73 {
74 push eax
75 push edx
76 push ecx
77 rdtsc
78 mov ecx, time
79 mov DWORD PTR [ecx], eax
80 mov DWORD PTR [ecx + 4], edx
81 pop ecx
82 pop edx
83 pop eax
84 }
85}
86
87U32 endHighResolutionTimer(U32 time[2])
88{
89 U32 ticks;
90 //ticks = Platform::getRealMilliseconds() - time[0];
91 //return ticks;
92
93 __asm
94 {
95 push eax
96 push edx
97 push ecx
98 //db 0fh, 31h
99 rdtsc
100 mov ecx, time
101 sub edx, DWORD PTR [ecx+4]
102 sbb eax, DWORD PTR [ecx]
103 mov DWORD PTR ticks, eax
104 pop ecx
105 pop edx
106 pop eax
107 }
108 return ticks;
109}
110
111#elif defined(TORQUE_SUPPORTS_GCC_INLINE_X86_ASM)
112
113// platform specific get hires times...
114void startHighResolutionTimer(U32 time[2])
115{
116 __asm__ __volatile__(
117 "rdtsc\n"
118 : "=a" (time[0]), "=d" (time[1])
119 );
120}
121
122U32 endHighResolutionTimer(U32 time[2])
123{

Callers 2

hashPushMethod · 0.85
hashPopMethod · 0.85

Calls 1

memcpyFunction · 0.85

Tested by

no test coverage detected