summaryrefslogtreecommitdiffstats
path: root/low-can-binding/utils/timer.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-07-17 10:59:10 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-07-21 12:02:11 +0200
commite2af4a871c6a8bcab4733193948833aed9c5ceb8 (patch)
tree2589bafe5de543fbc0dbccc3e13db8daa4acfabf /low-can-binding/utils/timer.cpp
parent61adb20886a9cc611a8b48a86998cfeaad31d7b7 (diff)
Format
Change-Id: I036befbfb38b01d046d35a1364c28e0835dcbd41 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/utils/timer.cpp')
-rw-r--r--low-can-binding/utils/timer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/low-can-binding/utils/timer.cpp b/low-can-binding/utils/timer.cpp
index d21b7474..9152a096 100644
--- a/low-can-binding/utils/timer.cpp
+++ b/low-can-binding/utils/timer.cpp
@@ -16,7 +16,7 @@
*/
#include <time.h>
-#include <stdlib.h>
+#include <stdlib.h>
#include <cmath>
#include "timer.hpp"
@@ -25,7 +25,7 @@ long long int system_time_us()
{
struct timespec t_usec;
long long int timestamp_usec = 0;
-
+
if(!::clock_gettime(CLOCK_MONOTONIC, &t_usec))
timestamp_usec = (t_usec.tv_nsec / 1000ll) + (t_usec.tv_sec* 1000000ll);
return timestamp_usec;
@@ -35,7 +35,7 @@ long long int system_time_ms()
{
struct timespec t_msec;
long long int timestamp_msec = 0;
-
+
if(!::clock_gettime(CLOCK_MONOTONIC, &t_msec))
timestamp_msec = (t_msec.tv_nsec / 1000000ll) + (t_msec.tv_sec* 1000ll);
return timestamp_msec;
@@ -45,7 +45,7 @@ long long int system_time_s()
{
struct timespec t_sec;
long long int timestamp_sec = 0;
-
+
if(!::clock_gettime(CLOCK_MONOTONIC, &t_sec))
timestamp_sec = t_sec.tv_sec;
return timestamp_sec;
@@ -76,7 +76,7 @@ float frequency_clock_t::frequency_to_period() const
return frequency_ == 0 ? 0 : 1 / frequency_;
}
-/// @brief Return a timeval struct based on the frequency_ member. used to
+/// @brief Return a timeval struct based on the frequency_ member. used to
/// specified CAN BCM timers.
const struct timeval frequency_clock_t::get_timeval_from_period() const
{