MCPcopy Create free account
hub / github.com/Inori/GPCS4 / GetProcessTimeCounter

Function GetProcessTimeCounter

GPCS4/Platform/PlatProcess.cpp:13–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#undef WIN32_LEAN_AND_MEAN
12
13uint64_t GetProcessTimeCounter()
14{
15 uint64_t nCounter = 0;
16 do
17 {
18 // TODO:
19 // this implement maybe not correct
20 // Microsoft saids we can't get the frequency of the cpu
21 // thus we can't calculate the elapsed time of a process
22 //ULONG64 nCycleTime = 0;
23 //if (!QueryProcessCycleTime(GetCurrentProcess(), &nCycleTime))
24 //{
25 // break;
26 //}
27 //nCounter = nCycleTime;
28
29 // TODO:
30 // this implementation maybe not correct either :(
31 // what we want is process time counter,
32 // but performance counter give us the general system counter
33 LARGE_INTEGER stCounter;
34 if (!QueryPerformanceCounter(&stCounter))
35 {
36 break;
37 }
38 nCounter = stCounter.QuadPart;
39
40 } while (false);
41 return nCounter;
42}
43
44uint64_t GetProcessTimeFrequency()
45{

Callers 5

writeMethod · 0.85
emuWriteGpuLabelMethod · 0.85
readStateMethod · 0.85
sceKernelReadTscFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected