コード例 #1
0
void Useri::PaaValikko() {
	//paavalikko metodin tulostus komennot ja alussa toteutetaan metodi joka tuo 
	//prosessorin tiedot ja käytettävien threadien lukumäärän
	GetProcessorName();
	cout<<"Alkulukugeneraattori"<<endl;
	cout<<"Mittaa tietokoneen prosessorin laskentatehoa"<<endl;
	cout<<"1 Laske alkuluvut"<<endl;
	cout<<"2 Tallenna alkuluvut"<<endl;
	cout<<"3 Lue alkuluvut a:sta b:hen"<<endl;
	cout<<"4 Tulos"<<endl;
	cout<<"5 Tallenna tulos"<<endl;
	cout<<"0 lopeta"<<endl;
};
コード例 #2
0
ファイル: CrashHandler.cpp プロジェクト: Nargesf/Sumatrapdf
static void GetSystemInfo(str::Str<char>& s)
{
    SYSTEM_INFO si;
    GetSystemInfo(&si);
    s.AppendFmt("Number Of Processors: %d\r\n", si.dwNumberOfProcessors);
    GetProcessorName(s);

    MEMORYSTATUSEX ms;
    ms.dwLength = sizeof(ms);
    GlobalMemoryStatusEx(&ms);

    float physMemGB   = (float)ms.ullTotalPhys     / (float)(1024 * 1024 * 1024);
    float totalPageGB = (float)ms.ullTotalPageFile / (float)(1024 * 1024 * 1024);
    DWORD usedPerc = ms.dwMemoryLoad;
    s.AppendFmt("Physical Memory: %.2f GB\r\nCommit Charge Limit: %.2f GB\r\nMemory Used: %d%%\r\n", physMemGB, totalPageGB, usedPerc);

    GetMachineName(s);
    GetLanguage(s);
    GetGraphicsDriverInfo(s);

    // Note: maybe more information, like:
    // * processor capabilities (mmx, sse, sse2 etc.)
}