From 7892ef9d248c189be68ce7faf63230ec0a318b67 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 14 Feb 2022 10:11:32 +0100 Subject: refactor: reorganize & add debugging --- src/time_utils.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 src/time_utils.cpp (limited to 'src/time_utils.cpp') diff --git a/src/time_utils.cpp b/src/time_utils.cpp deleted file mode 100644 index 84c7d96..0000000 --- a/src/time_utils.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "time_utils.hpp" -#include "Arduino.h" - -Time::Time(unsigned long time_micros) -{ - _time_micros = time_micros; -} - -void Time::update() -{ - _time_micros = micros(); -} - -Time Time::diff(Time prev_time) -{ - return Time(_time_micros - prev_time.microsecs()); -} - -unsigned long Time::microsecs() -{ - return _time_micros; -} - -unsigned long Time::millisecs() -{ - return _time_micros * 0.001; -} - -float Time::secs() -{ - return _time_micros * 0.000001; -} - -Time time_now() -{ - return Time(micros()); -} -- cgit v1.2.3-18-g5258