summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-15 00:44:51 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:21:57 +0100
commit29c259518cc53e2de8b2a082803c4ace40b1f754 (patch)
tree54e326f4c1efd06c44ef0b1826b45a50eca233aa
parent473b167761147a4cb36af86fea8e8c54bdf03d14 (diff)
Return period without unit conversion.
If conversion must be made then make it at the call not upstream. Change-Id: Ief6dee40355c7b39b5e27d0ba3dc02717fadf43b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--src/utils/timer.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/utils/timer.cpp b/src/utils/timer.cpp
index 9d385fe..784bb46 100644
--- a/src/utils/timer.cpp
+++ b/src/utils/timer.cpp
@@ -20,8 +20,6 @@
#include "timer.hpp"
-#define MS_PER_SECOND 1000
-
long long int system_time_us()
{
struct timespec t_usec;
@@ -64,7 +62,7 @@ frequency_clock_t::frequency_clock_t(float frequency)
/// @brief Return the period in ms given the frequency in hertz.
float frequency_clock_t::frequency_to_period(float frequency)
{
- return 1 / frequency * MS_PER_SECOND;
+ return 1 / frequency;
}
bool frequency_clock_t::started()