mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Fix unit reported by TimeTaker (was always ms)
This commit is contained in:
parent
8a44df8cba
commit
26495da94a
1 changed files with 11 additions and 2 deletions
|
@ -44,8 +44,17 @@ u32 TimeTaker::stop(bool quiet)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(quiet == false)
|
||||
infostream<<m_name<<" took "<<dtime<<"ms"<<std::endl;
|
||||
if (!quiet) {
|
||||
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;
|
||||
return dtime;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue