summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/timer.cpp9
-rw-r--r--src/utils/timer.hpp23
2 files changed, 21 insertions, 11 deletions
diff --git a/src/utils/timer.cpp b/src/utils/timer.cpp
index 8dec7066..433fcb26 100644
--- a/src/utils/timer.cpp
+++ b/src/utils/timer.cpp
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-#include "utils/timer.hpp"
+#include "timer.hpp"
long long int systemTimeMs()
{
@@ -28,4 +28,9 @@ long long int systemTimeMs()
t_msec.millitm;
}
return timestamp_msec;
-} \ No newline at end of file
+}
+
+
+frequency_clock_t::frequency_clock_t()
+ : frequency_{0.0}, last_tick_{0}, time_function_{nullptr}
+{} \ No newline at end of file
diff --git a/src/utils/timer.hpp b/src/utils/timer.hpp
index 7d0e4669..c8b7fb90 100644
--- a/src/utils/timer.hpp
+++ b/src/utils/timer.hpp
@@ -27,19 +27,24 @@
typedef long long int (*TimeFunction)();
/**
- * @struct FrequencyClock
+ * @class frequency_clock_t
* @brief A frequency counting clock.
*
- * @var FrequencyClock::frequency
+ * @var frequency_clock_t::frequency
* the clock frequency in Hz.
- * @var FrequencyClock::last_time
+ * @var frequency_clock_t::last_time
* the last time (in milliseconds since startup) that the clock
* ticked.
- * @var FrequencyClock::time_function
+ * @var frequency_clock_t::time_function
* a function returning current time
*/
-typedef struct {
- float frequency;
- unsigned long lastTick;
- TimeFunction timeFunction;
-} FrequencyClock; \ No newline at end of file
+class frequency_clock_t
+{
+private:
+ float frequency_;
+ unsigned long last_tick_;
+ TimeFunction time_function_;
+
+public:
+ frequency_clock_t();
+} \ No newline at end of file