diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-02-02 14:35:18 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-02-02 14:35:18 +0200 |
commit | 365f7a5bfe0cf1838b0c6f3936c4437f3dd9f1f7 (patch) | |
tree | 89d2c75eb94b975f36933820a6f492b822e1c4f0 /src/profiler.h | |
parent | 796009ef2152262ba9b2541256a880ff555449fd (diff) | |
parent | b85b4ede822b9d2d5f82c034e520341e9d86b08a (diff) | |
download | minetest-365f7a5bfe0cf1838b0c6f3936c4437f3dd9f1f7.tar.gz minetest-365f7a5bfe0cf1838b0c6f3936c4437f3dd9f1f7.tar.bz2 minetest-365f7a5bfe0cf1838b0c6f3936c4437f3dd9f1f7.zip |
Merge remote-tracking branch 'kahrl/hidehud'
Diffstat (limited to 'src/profiler.h')
-rw-r--r-- | src/profiler.h | 19 |
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); |