PROF_COUNTER: added string formatter method

This commit is contained in:
Tomasz Wlostowski 2021-11-28 21:50:07 +01:00
parent b59ee13fcc
commit 2f8ad08739
1 changed files with 7 additions and 0 deletions

View File

@ -149,6 +149,13 @@ public:
return SinceStart<DUR_MS>( aSinceLast ).count();
}
std::string to_string()
{
char tmp[1024];
snprintf( tmp, sizeof( tmp ), "%s: %-6.1fms", m_name.c_str(), msecs() );
return tmp;
}
private:
std::string m_name; // a string printed in message
bool m_running;