18 using Clock = std::chrono::high_resolution_clock;
19 typename Clock::time_point start_point;
24 inline Timer() : start_point(Clock::now()) {}
28 inline void reset(){ start_point = Clock::now(); }
33 template <
typename Rep =
double,
typename Units =
typename std::chrono::milliseconds>
35 std::atomic_thread_fence(std::memory_order_relaxed);
36 auto counted_time = std::chrono::duration_cast<Units>(Clock::now() - start_point).count();
37 std::atomic_thread_fence(std::memory_order_relaxed);
38 return static_cast<Rep
>(counted_time);
Wrapper for the implementation of a simple timer.
Definition: Timer.hpp:16
Timer()
Contructor already initiate the timer to the current time.
Definition: Timer.hpp:24
void reset()
Set the timer to the current time.
Definition: Timer.hpp:28
double elapsed() const
Returns the elapsed time.
Definition: Timer.hpp:34
UFJF-MLTK main namespace for core functionalities.
Definition: classifier/Classifier.hpp:11