diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-16 17:20:42 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-16 17:20:42 +0100 |
commit | 76df856e0df1b67770038e657f526f915c11a140 (patch) | |
tree | 413bb8405bc9a1abe0a0a029eaf483682347dc23 /src/utils/timer.hpp | |
parent | 6cdc94206f3c0cc60dca5ed024619b78dff01a64 (diff) |
Implement regular event launching using systemd event loop
Regular events is made launch a timerfd event from binder event loop and then
in the event handler, reschedule next launch in the future based upon the
signal frequency.
Change-Id: I0b1e84eb2135474f4bcc5ee256ba513eea4035a6
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/utils/timer.hpp')
-rw-r--r-- | src/utils/timer.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/timer.hpp b/src/utils/timer.hpp index b58397b..b34fdf6 100644 --- a/src/utils/timer.hpp +++ b/src/utils/timer.hpp @@ -17,8 +17,6 @@ #pragma once -#include <sys/timeb.h> - /* * @brief return epoch in milliseconds * @@ -26,8 +24,9 @@ */ typedef long long int (*time_function_t)(); - +long long int system_time_us(); long long int system_time_ms(); +long long int system_time_s(); /** * @class frequency_clock_t @@ -53,6 +52,7 @@ public: frequency_clock_t(float frequency); frequency_clock_t(float frequency, unsigned long last_tick, time_function_t time_function); + float get_frequency() const; static float frequency_to_period(float frequency); bool started(); time_function_t get_time_function(); |