From 539f016c1b1a706da2c113435ec60bb39c868f4b Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Tue, 13 Aug 2019 19:56:55 +0200 Subject: Better F6 profiler (#8750) Update the profiler names to make more sense of what they actually represent Move the profiler code from header to its source file Use monospace font to align lines Format the statistics line to align better with surrounding values Refresh the profiler each 3 seconds (roughly) --- src/client/clientenvironment.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/client/clientenvironment.cpp') diff --git a/src/client/clientenvironment.cpp b/src/client/clientenvironment.cpp index 9d92e51a6..e1b20ec84 100644 --- a/src/client/clientenvironment.cpp +++ b/src/client/clientenvironment.cpp @@ -285,15 +285,14 @@ void ClientEnvironment::step(float dtime) /* Step and handle simple objects */ - g_profiler->avg("CEnv: num of simple objects", m_simple_objects.size()); + g_profiler->avg("ClientEnv: CSO count [#]", m_simple_objects.size()); for (auto i = m_simple_objects.begin(); i != m_simple_objects.end();) { - auto cur = i; - ClientSimpleObject *simple = *cur; + ClientSimpleObject *simple = *i; simple->step(dtime); if(simple->m_to_be_removed) { delete simple; - i = m_simple_objects.erase(cur); + i = m_simple_objects.erase(i); } else { ++i; -- cgit v1.2.3