GetProcessTimes called periodically returns the same results
I'm calling GetProcessTimes() periodically in a loop which does the very
same thing on each iteration, but it seems to generate the same results
every time and only changes time to time. Is it a normal behaviour ?
Shouldn't the results change a little bit over time ?
void ImCalledPeriodically() {
static const DWORD dwPid = ::GetCurrentProcessId();
static const HANDLE hProc = ::OpenProcess( PROCESS_QUERY_INFORMATION,
FALSE, dwPid );
static FILETIME ftUnused1, ftUnused2; // Unused, mandatory parameters.
ULARGE_INTEGER uliUsr, uliKrn;
::GetProcessTimes( hProc, & ftUnused1, & ftUnused2, (_FILETIME *)&
uliKrn, (_FILETIME *)& uliUsr);
printf("usr=%I64d krn=%I64d", uliUsr.QuadPart, uliKrn.QuadPart );
// etc...
}
The output values only change time to times, for example :
641002, 641002, 641002, 641002 then 1092007, 1092007, 1092007, 1092007 etc...
Shouldn't it change a few every time ? Is there some kind of refresh rate
internal to the function ?
Thanks for your help.
No comments:
Post a Comment