aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/database.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2021-02-15 19:41:13 +0100
committerorwell96 <orwell@bleipb.de>2021-02-15 19:41:13 +0100
commit0bffd6ca647e3a332e66555e1a5d9866442cf6ef (patch)
tree95f36f89478fe6fc0b40ed231d213ba534930c1f /advtrains_interlocking/database.lua
parent556984940124c671c617fce1e81433dae39184f3 (diff)
Make DTIME_LIMIT and SAVE_INTERVAL globally accessible
Diffstat (limited to 'advtrains_interlocking/database.lua')
0 files changed, 0 insertions, 0 deletions
/span>(const std::string &name, u64 *result, TimePrecision prec) { m_name = name; m_result = result; m_precision = prec; m_time1 = porting::getTime(prec); } u64 TimeTaker::stop(bool quiet) { if (m_running) { u64 dtime = porting::getTime(m_precision) - m_time1; if (m_result != nullptr) { (*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; } u64 TimeTaker::getTimerTime() { return porting::getTime(m_precision) - m_time1; }