DWORD dwStartTick = GetTickCount();
DWORD dwIdleStart = GetIdleTime();
Sleep(1000);
DWORD dwStopTick = GetTickCount();
DWORD dwIdleStop = GetIdleTime();
int nCpu = 100-100*(dwIdleStop-dwIdleStart)/(dwStopTick-dwStartTick);
DWORD dwStartTick = GetTickCount();
DWORD dwIdleStart = GetIdleTime();
Sleep(1000);
DWORD dwStopTick = GetTickCount();
DWORD dwIdleStop = GetIdleTime();
int nCpu = 100-100*(dwIdleStop-dwIdleStart)/(dwStopTick-dwStartTick);