Untitled

 avatar
unknown
plain_text
2 years ago
527 B
4
Indexable
std::string formatDouble(double sayi) {
	std::ostringstream ss;
	ss << std::fixed << std::setprecision(2) << sayi;
	return ss.str();
}

std::string calc_mem() {
	double curr;
	std::string text;
	PROCESS_MEMORY_COUNTERS_EX pmc;
	if (GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*)&pmc, sizeof(pmc))) {
		SIZE_T vmes = pmc.PrivateUsage;
		double mbValue = static_cast<double>(vmes) / (1024 * 1024);
text = "Memory Usage: " + formatDouble(mbValue) + ";
		return text;
	}
	return "error?";
}
Editor is loading...
Leave a Comment