Fix unit reported by TimeTaker (was always ms)

This commit is contained in:
Kahrl 2014-10-09 11:15:03 +02:00
parent 8a44df8cba
commit 26495da94a

@ -44,8 +44,17 @@ u32 TimeTaker::stop(bool quiet)
} }
else else
{ {
if(quiet == false) if (!quiet) {
infostream<<m_name<<" took "<<dtime<<"ms"<<std::endl; static const char* const units[] = {
"s" /* PRECISION_SECONDS */,
"ms" /* PRECISION_MILLI */,
"us" /* PRECISION_MICRO */,
"ns" /* PRECISION_NANO */,
};
infostream << m_name << " took "
<< dtime << units[m_precision]
<< std::endl;
}
} }
m_running = false; m_running = false;
return dtime; return dtime;