¡@

Home 

c++ Programming Glossary: numprocessors

How to determine CPU and memory consumption from inside a process?

http://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process

ULARGE_INTEGER lastCPU lastSysCPU lastUserCPU static int numProcessors static HANDLE self void init SYSTEM_INFO sysInfo FILETIME ftime.. sysInfo FILETIME ftime fsys fuser GetSystemInfo &sysInfo numProcessors sysInfo.dwNumberOfProcessors GetSystemTimeAsFileTime &ftime.. percent now.QuadPart lastCPU.QuadPart percent numProcessors lastCPU now lastUserCPU user lastSysCPU sys return percent..