Skip to content

Commit b381960

Browse files
authored
Merge pull request #56 from ihsrobotics/cleanup-includes
Cleanup includes
2 parents 4e860b9 + 556a4bf commit b381960

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.0)
2-
project(ihs_boost VERSION 1.7.0)
2+
project(ihs_boost VERSION 1.7.1)
33

44
# options
55
option(build_tests "build_tests" OFF)

modules/threading/src/accumulator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "accumulator.hpp"
2-
#include <kipr/wombat.h>
32

43
Accumulator::Accumulator(std::function<double()> callable, int updates_per_sec)
54
: BackgroundTask(updates_per_sec), callable(callable),

modules/util/include/timer.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#ifndef IHSBOOST_TIMER_HPP
1414
#define IHSBOOST_TIMER_HPP
1515

16+
#include <chrono>
17+
1618
/**
1719
* @brief A class that implements a timer, useful when you want
1820
* to line-follow for a certain amount of time.
@@ -47,8 +49,8 @@ class Timer
4749
bool done() const;
4850

4951
private:
50-
double _time;
51-
double _start_time;
52+
int _time;
53+
std::chrono::steady_clock::time_point _start_time;
5254
};
5355

5456
#endif

modules/util/src/timer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "timer.hpp"
2-
#include <kipr/wombat.h>
32

4-
Timer::Timer(double time) : _time(time), _start_time(seconds()){};
3+
Timer::Timer(double time) : _time(static_cast<int>(time * 1000000)), _start_time(std::chrono::steady_clock::now()){};
54

65
bool Timer::operator()() const { return done(); }
7-
bool Timer::done() const { return seconds() - _start_time >= _time; }
6+
bool Timer::done() const { return std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - _start_time).count() >= _time; }

0 commit comments

Comments
 (0)