mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 06:21:19 +12:00
Cleanup
This commit is contained in:
parent
feefdf5fc4
commit
002acbd7a0
2 changed files with 20 additions and 20 deletions
|
@ -13,6 +13,18 @@ uint32_t GetProcessorCount()
|
|||
return std::thread::hardware_concurrency();
|
||||
}
|
||||
|
||||
uint64_t QueryRamUsage()
|
||||
{
|
||||
long page_size = sysconf(_SC_PAGESIZE);
|
||||
|
||||
std::ifstream file("/proc/self/statm");
|
||||
file.ignore(std::numeric_limits<std::streamsize>::max(), ' ');
|
||||
uint64_t no_pages;
|
||||
file >> no_pages;
|
||||
|
||||
return no_pages * page_size;
|
||||
}
|
||||
|
||||
void QueryProcTime(uint64_t &out_now, uint64_t &out_user, uint64_t &out_kernel)
|
||||
{
|
||||
struct tms time_info;
|
||||
|
@ -42,16 +54,4 @@ void QueryCoreTimes(uint32_t count, ProcessorTime out[])
|
|||
}
|
||||
}
|
||||
|
||||
uint64_t QueryRamUsage()
|
||||
{
|
||||
long page_size = sysconf(_SC_PAGESIZE);
|
||||
|
||||
std::ifstream file("/proc/self/statm");
|
||||
file.ignore(std::numeric_limits<std::streamsize>::max(), ' ');
|
||||
uint64_t no_pages;
|
||||
file >> no_pages;
|
||||
|
||||
return no_pages * page_size;
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue