Code tweaks and cleanup.

This commit is contained in:
spx
2011-12-09 03:28:19 +00:00
parent 8e8b7d1268
commit 2835739b12
11 changed files with 164 additions and 86 deletions

View File

@ -27,7 +27,14 @@
#define SystemProcessorPerformanceInformation 8
//#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + (double)((x).LowPart))
typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
LARGE_INTEGER IdleTime;
LARGE_INTEGER KernelTime;
LARGE_INTEGER UserTime;
LARGE_INTEGER Reserved1[2];
ULONG Reserved2;
} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
#define Li2Double(x) ((double)((x).QuadPart))
#define Ft2Double(x) ((double)((x).dwHighDateTime) * 4.294967296E9 + (double)((x).dwLowDateTime))
@ -72,7 +79,7 @@ CMeasureCPU::CMeasureCPU(CMeterWindow* meterWindow, const WCHAR* name) : CMeasur
}
if (c_NumOfProcessors == 0)
{
SYSTEM_INFO systemInfo = {0};
SYSTEM_INFO systemInfo;
GetSystemInfo(&systemInfo);
c_NumOfProcessors = (int)systemInfo.dwNumberOfProcessors;
}