summaryrefslogtreecommitdiff
path: root/src/profiler.h
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2012-02-01 00:56:30 +0100
committerKahrl <kahrl@gmx.net>2012-02-01 00:56:30 +0100
commit0c3d39357b7006844f5e86baf21704d3fa8a7be7 (patch)
treec26b550d9b953131c421723b138e521616be8dec /src/profiler.h
parent0e8bd531c243c4e19217ef249c2316710cee44cc (diff)
downloadminetest-0c3d39357b7006844f5e86baf21704d3fa8a7be7.tar.gz
minetest-0c3d39357b7006844f5e86baf21704d3fa8a7be7.tar.bz2
minetest-0c3d39357b7006844f5e86baf21704d3fa8a7be7.zip
F1 toggles HUD, F2 toggles chat, F5 toggles debug info, F6 toggles profiler pages
Diffstat (limited to 'src/profiler.h')
-rw-r--r--src/profiler.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/profiler.h b/src/profiler.h
index 129118ef6..7bb3b3750 100644
--- a/src/profiler.h
+++ b/src/profiler.h
@@ -100,11 +100,30 @@ public:
void print(std::ostream &o)
{
+ printPage(o, 1, 1);
+ }
+
+ void printPage(std::ostream &o, u32 page, u32 pagecount)
+ {
JMutexAutoLock lock(m_mutex);
+
+ u32 minindex, maxindex;
+ paging(m_data.size(), page, pagecount, minindex, maxindex);
+
for(core::map<std::string, float>::Iterator
i = m_data.getIterator();
i.atEnd() == false; i++)
{
+ if(maxindex == 0)
+ break;
+ maxindex--;
+
+ if(minindex != 0)
+ {
+ minindex--;
+ continue;
+ }
+
std::string name = i.getNode()->getKey();
int avgcount = 1;
core::map<std::string, int>::Node *n = m_avgcounts.find(name);