aboutsummaryrefslogtreecommitdiff
path: root/src/convert_json.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2016-10-05 00:13:10 +0200
committerNer'zhul <nerzhul@users.noreply.github.com>2016-10-05 07:30:32 +0200
commit5f084cd98d7b3326b51320455364337539710efd (patch)
treed66681421b1b1dfa18d1feb3f0a66d5c03e00c86 /src/convert_json.cpp
parentd4c76258e37337ea585cf24d8e05b50a30fa307d (diff)
downloadminetest-5f084cd98d7b3326b51320455364337539710efd.tar.gz
minetest-5f084cd98d7b3326b51320455364337539710efd.tar.bz2
minetest-5f084cd98d7b3326b51320455364337539710efd.zip
Make some maps unordered to improve performance
* This permit to improve performance on C++11 builds * use some existing typedefs in tools maps * minor code style changes
Diffstat (limited to 'src/convert_json.cpp')
0 files changed, 0 insertions, 0 deletions
quot; #include "../log.h" #include <ostream> TimeTaker::TimeTaker(const char *name, u32 *result, TimePrecision prec) { m_name = name; m_result = result; m_running = true; m_precision = prec; m_time1 = getTime(prec); } u32 TimeTaker::stop(bool quiet) { if(m_running) { u32 time2 = getTime(m_precision); u32 dtime = time2 - m_time1; if(m_result != NULL) { (*m_result) += dtime; } else { 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; } return 0; } u32 TimeTaker::getTimerTime() { u32 time2 = getTime(m_precision); u32 dtime = time2 - m_time1; return dtime; }