13 #ifndef MLPACK_CORE_UTILITIES_TIMERS_HPP
14 #define MLPACK_CORE_UTILITIES_TIMERS_HPP
22 #if !defined(HAVE_UINT64_T)
23 #if SIZEOF_UNSIGNED_LONG == 8
24 typedef unsigned long uint64_t;
26 typedef unsigned long long uint64_t;
27 #endif // SIZEOF_UNSIGNED_LONG
28 #endif // HAVE_UINT64_T
52 static void Start(
const std::string& name);
62 static void Stop(
const std::string& name);
69 static std::chrono::microseconds
Get(
const std::string& name);
81 std::map<std::string, std::chrono::microseconds>&
GetAllTimers();
88 std::chrono::microseconds
GetTimer(
const std::string& timerName);
106 void StartTimer(
const std::string& timerName);
114 void StopTimer(
const std::string& timerName);
121 bool GetState(std::string timerName);
125 std::map<std::string, std::chrono::microseconds> timers;
127 std::map<std::string, bool> timerState;
129 std::map<std::string, std::chrono::high_resolution_clock::time_point>
132 std::chrono::high_resolution_clock::time_point GetTime();
137 #endif // MLPACK_CORE_UTILITIES_TIMERS_HPP
std::map< std::string, std::chrono::microseconds > & GetAllTimers()
Returns a copy of all the timers used via this interface.
void StartTimer(const std::string &timerName)
* Initializes a timer, available like a normal value specified on * the command line...
static std::chrono::microseconds Get(const std::string &name)
Get the value of the given timer.
static void Stop(const std::string &name)
Stop the given timer.
void PrintTimer(const std::string &timerName)
Prints the specified timer.
bool GetState(std::string timerName)
Returns state of the given timer.
The timer class provides a way for mlpack methods to be timed.
Timers()
Nothing to do for the constructor.
static void Start(const std::string &name)
Start the given timer.
void StopTimer(const std::string &timerName)
* Halts the timer, and replaces it's value with * the delta time from it's start * *...
std::chrono::microseconds GetTimer(const std::string &timerName)
Returns a copy of the timer specified.