14 #ifndef MLPACK_CORE_UTILITIES_TIMERS_HPP
15 #define MLPACK_CORE_UTILITIES_TIMERS_HPP
27 #if !defined(HAVE_UINT64_T)
28 #if SIZEOF_UNSIGNED_LONG == 8
29 typedef unsigned long uint64_t;
31 typedef unsigned long long uint64_t;
32 #endif // SIZEOF_UNSIGNED_LONG
33 #endif // HAVE_UINT64_T
106 std::map<std::string, std::chrono::microseconds>
GetAllTimers();
140 const std::thread::id& threadId = std::thread::id());
149 const std::thread::id& threadId = std::thread::id());
158 const std::thread::id& threadId = std::thread::id());
166 std::atomic<bool>&
Enabled() {
return enabled; }
172 std::map<std::string, std::chrono::microseconds> timers;
174 std::mutex timersMutex;
177 std::chrono::high_resolution_clock::time_point>> timerStartTime;
180 std::atomic<bool> enabled;
185 #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 StopAllTimers()
Stop all timers.
std::atomic< bool > & Enabled()
Modify whether or not timing is enabled.
static std::chrono::microseconds Get(const std::string &name)
Get the value of the given timer.
bool GetState(const std::string &timerName, const std::thread::id &threadId=std::thread::id())
Returns state of the given timer.
void StartTimer(const std::string &timerName, const std::thread::id &threadId=std::thread::id())
* Initializes a timer, available like a normal value specified on * the command line...
static void Stop(const std::string &name)
Stop the given timer.
void PrintTimer(const std::string &timerName)
Prints the specified timer.
bool Enabled() const
Get whether or not timing is enabled.
void StopTimer(const std::string &timerName, const std::thread::id &threadId=std::thread::id())
* Halts the timer, and replaces its value with the delta time from its start.
static void EnableTiming()
Enable timing of mlpack programs.
The timer class provides a way for mlpack methods to be timed.
static void ResetAll()
Stop and reset all running timers.
Timers()
Default to disabled.
static void DisableTiming()
Disable timing of mlpack programs.
static void Start(const std::string &name)
Start the given timer.
void Reset()
Reset the timers.
std::chrono::microseconds GetTimer(const std::string &timerName)
Returns a copy of the timer specified.
src mlpack core util version hpp VERSION_HPP_CONTENTS string(REGEX REPLACE".*#define MLPACK_VERSION_MAJOR ([0-9]+).*""\\1"MLPACK_VERSION_MAJOR"${VERSION_HPP_CONTENTS}") string(REGEX REPLACE".* MLPACK_VERSION_MINOR "$