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

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