CSystem.cpp 368 B

123456789101112131415161718192021222324252627282930313233
  1. #include "../pch/pch.h"
  2. #include "CSystem.h"
  3. CSystem::CSystem()
  4. {
  5. }
  6. CSystem::~CSystem()
  7. {
  8. }
  9. int CSystem::get_CPU_core_num()
  10. {
  11. #ifdef _WIN32
  12. SYSTEM_INFO info;
  13. GetSystemInfo(&info);
  14. return info.dwNumberOfProcessors;
  15. #else
  16. return get_nprocs();
  17. #endif
  18. }
  19. void CSystem::my_sleep(int second)
  20. {
  21. #ifdef _WIN32
  22. Sleep(second * 1000);
  23. #else
  24. sleep(second);
  25. #endif
  26. }