summaryrefslogtreecommitdiff
path: root/src/common/timer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/timer.hpp')
-rw-r--r--src/common/timer.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/timer.hpp b/src/common/timer.hpp
index fc4f8cb..db4dedd 100644
--- a/src/common/timer.hpp
+++ b/src/common/timer.hpp
@@ -10,9 +10,13 @@ enum TIMER_TYPE
TIMER_INTERVAL,
};
/// This is needed to produce a signed result when 2 ticks are subtracted
-# define DIFF_TICK(a,b) ((int32_t)((a)-(b)))
+inline
+int32_t DIFF_TICK(int32_t a, int32_t b)
+{
+ return a - b;
+}
-// TODO replace with signed 64-bit to make code more clear and protect from the future
+// TODO replace with std::chrono::time_point and std::chrono::duration
typedef uint32_t tick_t;
typedef uint32_t interval_t;
typedef uint32_t timer_id;