mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-07 23:41:18 +12:00
Use std:🧵:hardware_concurrency for all platforms.
This commit is contained in:
parent
5303f8011d
commit
64772d4313
3 changed files with 5 additions and 12 deletions
|
@ -18,6 +18,11 @@ double ProcessorTime::Compare(ProcessorTime &last, ProcessorTime &now)
|
||||||
return (double)dwork / dtotal;
|
return (double)dwork / dtotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 GetProcessorCount()
|
||||||
|
{
|
||||||
|
return std::thread::hardware_concurrency();
|
||||||
|
}
|
||||||
|
|
||||||
void QueryProcTime(ProcessorTime &out)
|
void QueryProcTime(ProcessorTime &out)
|
||||||
{
|
{
|
||||||
uint64 now, user, kernel;
|
uint64 now, user, kernel;
|
||||||
|
|
|
@ -7,11 +7,6 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
uint32 GetProcessorCount()
|
|
||||||
{
|
|
||||||
return std::thread::hardware_concurrency();
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64 QueryRamUsage()
|
uint64 QueryRamUsage()
|
||||||
{
|
{
|
||||||
long page_size = sysconf(_SC_PAGESIZE);
|
long page_size = sysconf(_SC_PAGESIZE);
|
||||||
|
|
|
@ -6,13 +6,6 @@
|
||||||
#include <winternl.h>
|
#include <winternl.h>
|
||||||
#pragma comment(lib, "ntdll.lib")
|
#pragma comment(lib, "ntdll.lib")
|
||||||
|
|
||||||
uint32 GetProcessorCount()
|
|
||||||
{
|
|
||||||
SYSTEM_INFO sys_info;
|
|
||||||
GetSystemInfo(&sys_info);
|
|
||||||
return sys_info.dwNumberOfProcessors;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64 QueryRamUsage()
|
uint64 QueryRamUsage()
|
||||||
{
|
{
|
||||||
PROCESS_MEMORY_COUNTERS pmc{};
|
PROCESS_MEMORY_COUNTERS pmc{};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue