| 123456789101112131415161718192021222324252627 |
- #pragma once
- class CSystem
- {
- public:
- CSystem();
- ~CSystem();
- static int get_CPU_core_num();
- //程序休眠X秒
- static void my_sleep(int second);
- static std::wstring GetProgramDir()
- {
- wchar_t exeFullPath[MAX_PATH]; // Full path
- std::wstring strPath = L"";
- GetModuleFileName(NULL, exeFullPath, MAX_PATH);
- strPath = (wstring)exeFullPath; // Get full path of the file
- int pos = strPath.find_last_of('\\', strPath.length());
- return strPath.substr(0, pos); // Return the directory without the file name
- }
- };
|