summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-06-15 06:36:56 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-06-18 18:48:42 +0200
commit7f68fc115abebd617d495a7d1a18b4fa0158c8e2 (patch)
tree4b1ba4e4e8ce4910bce4507c1b27bbcb8e2e7c38
parent382875c5d0e0d7e469b1a4607d3f25938bc286c5 (diff)
compat/time: don't use "long long" for milliseconds
-rw-r--r--compat/time.hpp1
-rw-r--r--logic/tracker.cpp6
2 files changed, 3 insertions, 4 deletions
diff --git a/compat/time.hpp b/compat/time.hpp
index c07f29cb..e65e4855 100644
--- a/compat/time.hpp
+++ b/compat/time.hpp
@@ -18,7 +18,6 @@ static inline constexpr auto time_cast(const u& in)
using secs = duration<double>;
using secs_ = duration<long>;
using ms = duration<double, std::milli>;
-using ms_ = duration<long long, std::milli>;
using us = duration<double, std::micro>;
using us_ = duration<long long, std::micro>;
using ns = duration<long long, std::nano>;
diff --git a/logic/tracker.cpp b/logic/tracker.cpp
index 81854d0d..a5d4b86f 100644
--- a/logic/tracker.cpp
+++ b/logic/tracker.cpp
@@ -388,7 +388,7 @@ void Tracker::run()
{
logic();
- static constexpr ns const_sleep_ms(time_cast<ns>(ms_(4)));
+ static constexpr ns const_sleep_ms(time_cast<ns>(ms(4)));
const ns elapsed_nsecs = prog1(t.elapsed<ns>(), t.start());
if (backlog_time > secs_(3) || backlog_time < secs_(-3))
@@ -400,8 +400,8 @@ void Tracker::run()
backlog_time += ns(elapsed_nsecs - const_sleep_ms);
- const int sleep_time_ms = time_cast<ms_>(clamp(const_sleep_ms - backlog_time,
- ms_::zero(), ms_(10))).count();
+ const int sleep_time_ms = time_cast<ms>(clamp(const_sleep_ms - backlog_time,
+ ms::zero(), ms(10))).count();
#if 0
qDebug() << "sleepy time" << sleep_time_ms