Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0)
project(ihs_boost VERSION 1.7.0)
project(ihs_boost VERSION 1.7.1)

# options
option(build_tests "build_tests" OFF)
Expand Down
1 change: 0 additions & 1 deletion modules/threading/src/accumulator.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "accumulator.hpp"
#include <kipr/wombat.h>

Accumulator::Accumulator(std::function<double()> callable, int updates_per_sec)
: BackgroundTask(updates_per_sec), callable(callable),
Expand Down
6 changes: 4 additions & 2 deletions modules/util/include/timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#ifndef IHSBOOST_TIMER_HPP
#define IHSBOOST_TIMER_HPP

#include <chrono>

/**
* @brief A class that implements a timer, useful when you want
* to line-follow for a certain amount of time.
Expand Down Expand Up @@ -47,8 +49,8 @@ class Timer
bool done() const;

private:
double _time;
double _start_time;
int _time;
std::chrono::steady_clock::time_point _start_time;
};

#endif
Expand Down
5 changes: 2 additions & 3 deletions modules/util/src/timer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "timer.hpp"
#include <kipr/wombat.h>

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

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