diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-10 02:02:00 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-16 17:10:40 +0100 |
commit | 04f14d0017e94177c6afdf4f5b7df71f25fbc18e (patch) | |
tree | b79ae20c8e30b7cf3f685eec97c0e13ef6d0e260 /src/utils/timer.hpp | |
parent | 7735f7d8603859431af40702f3e274c5e1d90e5c (diff) |
Adding needed function to get some time handle on request
for diagnostic at first.
Change-Id: I3ab966d6386bad52f68ebdbea723bb7507cfaf2a
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/utils/timer.hpp')
-rw-r--r-- | src/utils/timer.hpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/utils/timer.hpp b/src/utils/timer.hpp index a3cbecd6..8037b85d 100644 --- a/src/utils/timer.hpp +++ b/src/utils/timer.hpp @@ -24,7 +24,10 @@ * * @return long long int epoch in milliseconds */ -typedef long long int (*TimeFunction)(); +typedef long long int (*time_function_t)(); + + +long long int system_time_ms(); /** * @class frequency_clock_t @@ -43,8 +46,14 @@ class frequency_clock_t private: float frequency_; unsigned long last_tick_; - TimeFunction time_function_; + time_function_t time_function_; public: frequency_clock_t(); + frequency_clock_t(float frequency); + + static float frequency_to_period(float frequency); + bool started(); + time_function_t get_time_function(); + bool elapsed(bool stagger); };
\ No newline at end of file |