aboutsummaryrefslogtreecommitdiff
path: root/src/util/timetaker.cpp
diff options
context:
space:
mode:
authorWeblate <42@minetest.ru>2013-03-30 19:49:52 +0100
committerWeblate <42@minetest.ru>2013-03-30 19:49:52 +0100
commita0566270d9fa075afa36a7e3e68c690b1b23ba90 (patch)
tree6bc88127ee67b7bf4d6a2d6f9d0a9e5f997d1dd1 /src/util/timetaker.cpp
parent0d83bdc3aa9f1077836aacb833ac4ad9bbb9a4f4 (diff)
parent1aa50b13622c1e264044839ecdf0152670dae6ce (diff)
downloadminetest-a0566270d9fa075afa36a7e3e68c690b1b23ba90.tar.gz
minetest-a0566270d9fa075afa36a7e3e68c690b1b23ba90.tar.bz2
minetest-a0566270d9fa075afa36a7e3e68c690b1b23ba90.zip
Merge remote branch 'origin/master'
Diffstat (limited to 'src/util/timetaker.cpp')
-rw-r--r--src/util/timetaker.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/util/timetaker.cpp b/src/util/timetaker.cpp
index 910fea822..720a9e1a9 100644
--- a/src/util/timetaker.cpp
+++ b/src/util/timetaker.cpp
@@ -23,19 +23,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "../log.h"
#include <ostream>
-TimeTaker::TimeTaker(const char *name, u32 *result)
+TimeTaker::TimeTaker(const char *name, u32 *result, TimePrecision prec)
{
m_name = name;
m_result = result;
m_running = true;
- m_time1 = getTimeMs();
+ m_precision = prec;
+ m_time1 = getTime(prec);
}
u32 TimeTaker::stop(bool quiet)
{
if(m_running)
{
- u32 time2 = getTimeMs();
+ u32 time2 = getTime(m_precision);
u32 dtime = time2 - m_time1;
if(m_result != NULL)
{
@@ -52,9 +53,9 @@ u32 TimeTaker::stop(bool quiet)
return 0;
}
-u32 TimeTaker::getTime()
+u32 TimeTaker::getTimerTime()
{
- u32 time2 = getTimeMs();
+ u32 time2 = getTime(m_precision);
u32 dtime = time2 - m_time1;
return dtime;
}