X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Futils%2Ftimer.hpp;h=b34fdf643f13b234660e7aba32995e8ec4c94403;hb=4e2d038c42d6995d69239455ec4fbad9931fcfd5;hp=8037b85d9ea07dd02d2dbe67244135440dd5599b;hpb=04f14d0017e94177c6afdf4f5b7df71f25fbc18e;p=apps%2Flow-level-can-service.git diff --git a/src/utils/timer.hpp b/src/utils/timer.hpp index 8037b85..b34fdf6 100644 --- a/src/utils/timer.hpp +++ b/src/utils/timer.hpp @@ -17,8 +17,6 @@ #pragma once -#include - /* * @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 @@ -51,9 +50,13 @@ private: public: frequency_clock_t(); 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(); bool elapsed(bool stagger); + + void tick(); }; \ No newline at end of file