From bcdce9633dc351d3bc7f347a165348b8fab87cd9 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 15 Feb 2022 12:33:52 +0100 Subject: refactor: reorganize files & improve classes --- src/utils/time.cpp | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/utils/time.cpp (limited to 'src/utils/time.cpp') diff --git a/src/utils/time.cpp b/src/utils/time.cpp deleted file mode 100644 index c6d981c..0000000 --- a/src/utils/time.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "time.hpp" - -#include - -Time::Time(uint64_t 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()); -} - -double Time::secs() -{ - const double micros_to_secs = 0.000001; - - return static_cast(_time_micros) * micros_to_secs; -} - -double Time::millisecs() -{ - const double micros_to_millis = 0.001; - - return static_cast(_time_micros) * micros_to_millis; -} - -uint64_t Time::microsecs() -{ - return _time_micros; -} - -Time time_now() -{ - return Time(micros()); -} -- cgit v1.2.3-18-g5258