Skip to content

Commit

Permalink
Console: Add 'estimateCPUMem' command
Browse files Browse the repository at this point in the history
  • Loading branch information
ataulien committed Jul 2, 2018
1 parent 671bc5c commit f9afcb4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/target/REGoth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ void REGoth::initConsole()
return suggestions;
};


console.registerCommand("estimatedCPUMem", [this](const std::vector<std::string>& args) -> std::string {
World::WorldInstance& world = m_pEngine->getMainWorld().get();

std::stringstream ss;
ss << "Current world CPU Memory Consumption (Rough estimate!):" << std::endl
<< " - Entities: " << world.getComponentAllocator().getNumBytesUsed() / 1024 / 1024 << "/" << world.getComponentAllocator().getNumBytesTotal() / 1024 / 1024 << std::endl
<< " -";

return ss.str();
});

console.registerCommand("estimatedGPUMem", [this](const std::vector<std::string>& args) -> std::string {
World::WorldInstance& world = m_pEngine->getMainWorld().get();

Expand Down

0 comments on commit f9afcb4

Please sign in to comment.