Aufgrund einer Wartung wird GitLab am 21.09. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 21.09. between 8:00 and 9:00 am.

Commit 95d5270d authored by Jonas Stienen's avatar Jonas Stienen
Browse files

Linux compatible stopwatch fixes (to_string abandoned)

parent ae917c9e
......@@ -163,14 +163,17 @@ double ITAStopWatch::selftest()
std::string TimeToString( double dTimeSeconds)
{
if (dTimeSeconds < 1e-6)
return std::string(std::to_string( long double( dTimeSeconds / 1e-9) ) + "us");
std::stringstream ss;
if( dTimeSeconds < 1e-6 )
ss << dTimeSeconds / 1e-9 << "us";
else if (dTimeSeconds < 1e-3)
return std::string(std::to_string( long double( dTimeSeconds / 1e-6)) + "ns");
ss << dTimeSeconds / 1e-6 << "ns";
else if (dTimeSeconds < 1e-0)
return std::string(std::to_string( long double( dTimeSeconds / 1e-3)) + "ms");
ss << dTimeSeconds / 1e-3 << "ms";
else
return std::string(std::to_string( long double( dTimeSeconds)) + "s");
ss << dTimeSeconds << "s";
return ss.str();
};
std::string ITAStopWatch::ToString() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment