include/GizegoEngine.h
//Returns the frequency of the CPU in MHz. Needs windows.h
Returns the frequency of the CPU in MHz.
Returns the frequency of the CPU in MHz .
unsigned long long GetCPUFrequency()
		{
#ifdef _WINDOWS_
			DWORD BufSize = _MAX_PATH;
			DWORD dwMHz = _MAX_PATH;
			HKEY hKey;
			long lError = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", 0, KEY_READ, &hKey);
			if (lError != ERROR_SUCCESS)
			{
				ThrowException(L"Can't open registry to get CPU frequency");
				return 0;
			}
			RegQueryValueEx(hKey, "~MHz", NULL, NULL, (LPBYTE)&dwMHz, &BufSize);
			return dwMHz;
#else
			#warning Hardware::GetCPUFrequency will not work.include windows.h
			ThrowException(L"Windows is not included in this window build so you can't call this function");
			return 0;
#endif
		}
unsigned long long GetCPUFrequency ( ) { #ifdef _WINDOWS_ DWORD BufSize = _MAX_PATH ; DWORD dwMHz = _MAX_PATH ; HKEY hKey ; long lError = RegOpenKeyEx ( HKEY_LOCAL_MACHINE , " \\ \\ \\ \\ " , 0 , KEY_READ , & hKey ) ; if ( lError != ERROR_SUCCESS ) { ThrowException ( L" " ) ; return 0 ; } RegQueryValueEx ( hKey , " " , NULL , NULL , ( LPBYTE ) & dwMHz , & BufSize ) ; return dwMHz ; #else #warning  Hardware::GetCPUFrequency will not work.include windows.h ThrowException ( L" " ) ; return 0 ; #endif }
Returns the frequency of the CPU in MHz.
Returns the frequency of the CPU in MHz .