예제 #1
0
int main(int argc, char* argv[]) {
	int processID=0;
	CCpuUsage usageA;
	CCpuUsage usageB;
	
	printf("SystemWide Cpu Usage	 Wengophone cpu usage\n");
	printf("====================	 ====================\n");
	while (true) {
		// Display the system-wide cpu usage and the "wengophone" cpu usage
		int SystemWideCpuUsage = usageA.GetCpuUsage();
		int ProcessCpuUsageByName = usageB.GetCpuUsage("wengophone");
		printf("%19d%% %22d%% \r",SystemWideCpuUsage, ProcessCpuUsageByName);
		Sleep(1000);
	}
	return 0;
}
예제 #2
0
파일: Main.cpp 프로젝트: dreieier/Nexus
int main(int argc, char* argv[])
{
	int processID=0;
	CCpuUsage usageA;
	CCpuUsage usageB;
	CCpuUsage usageC;

	printf("SystemWide Cpu Usage	 Explorer cpu usage	   Cpu Usage for processID 0\n"); 
	printf("====================	 ==================	   ========================\n"); 
	while (true)
	{
		// Display the system-wide cpu usage and the "Explorer" cpu usage
		
		int SystemWideCpuUsage = usageA.GetCpuUsage();
		int ProcessCpuUsageByName = usageB.GetCpuUsage("explorer");
		int ProcessCpuUsageByID = usageC.GetCpuUsage(processID);
		printf("%19d%%%22d%%%31d%%\r",SystemWideCpuUsage, ProcessCpuUsageByName, ProcessCpuUsageByID);

		Sleep(1000);
	}
	return 0;
}