6#if __has_include(<cereal/cereal.hpp>)
7#include <cereal/cereal.hpp>
21 std::chrono::high_resolution_clock::time_point start;
30 timer(
bool run =
true) noexcept;
40 void reset(std::chrono::high_resolution_clock::time_point time) noexcept;
48 unsigned int micros() const noexcept;
56 unsigned int millis() const noexcept;
80 unsigned int hours() const noexcept;
83#if __has_include(<cereal/cereal.hpp>)
88 template <
class Archive>
89 void save(Archive &ar)
const {
91 ar(CEREAL_NVP(elapsed));
98 template <
class Archive>
99 void load(Archive &ar) {
101 ar(CEREAL_NVP(elapsed));
102 reset(std::chrono::high_resolution_clock::now() - std::chrono::microseconds(elapsed));
unsigned int hours() const noexcept
Get the elapsed time in minutes.
unsigned int millis() const noexcept
Get the elapsed time in milliseconds.
void reset() noexcept
Reset the timer.
timer(bool run=true) noexcept
Timer constructor.
unsigned int seconds() const noexcept
Get the elapsed time in seconds.
unsigned int micros() const noexcept
Get the elapsed time in microseconds.
unsigned int minutes() const noexcept
Get the elapsed time in minutes.
Section containing core functions and classes.