projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a44df8
)
Fix unit reported by TimeTaker (was always ms)
author
Kahrl
<kahrl@gmx.net>
Thu, 9 Oct 2014 09:15:03 +0000
(11:15 +0200)
committer
Kahrl
<kahrl@gmx.net>
Thu, 9 Oct 2014 09:15:03 +0000
(11:15 +0200)
src/util/timetaker.cpp
patch
|
blob
|
history
diff --git
a/src/util/timetaker.cpp
b/src/util/timetaker.cpp
index 720a9e1a976e4a78ff1919caa08a74156f2ed776..dcf07dc0d02f35df6912a6245fe269227b76f152 100644
(file)
--- a/
src/util/timetaker.cpp
+++ b/
src/util/timetaker.cpp
@@
-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;