15 #ifndef __MLPACK_CORE_UTILITIES_TIMERS_HPP 16 #define __MLPACK_CORE_UTILITIES_TIMERS_HPP 21 #if defined(__unix__) || defined(__unix) 25 #elif defined(__MACH__) && defined(__APPLE__) 26 #include <mach/mach_time.h> 35 #define NOMINMAX // Don't define min and max macros. 44 #if !defined(HAVE_UINT64_T) 45 #if SIZEOF_UNSIGNED_LONG == 8 46 typedef unsigned long uint64_t;
48 typedef unsigned long long uint64_t;
49 #endif // SIZEOF_UNSIGNED_LONG 50 #endif // HAVE_UINT64_T 53 #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) 54 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 56 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL 57 #endif // _MSC_VER, _MSC_EXTENSIONS 83 static void Start(
const std::string& name);
93 static void Stop(
const std::string& name);
100 static timeval
Get(
const std::string& name);
112 std::map<std::string, timeval>& GetAllTimers();
119 timeval GetTimer(
const std::string& timerName);
127 void PrintTimer(
const std::string& timerName);
137 void StartTimer(
const std::string& timerName);
145 void StopTimer(
const std::string& timerName);
152 bool GetState(std::string timerName);
160 void FileTimeToTimeVal(timeval* tv);
161 void GetTime(timeval* tv);
166 #endif // __MLPACK_CORE_UTILITIES_TIMERS_HPP std::map< std::string, bool > timerState
A map that contains whether or not each timer is currently running.
Timers()
Nothing to do for the constructor.
Linear algebra utility functions, generally performed on matrices or vectors.
std::map< std::string, timeval > timers
A map of all the timers that are being tracked.
static void Start(const std::string &name)
Start the given timer.
static timeval Get(const std::string &name)
Get the value of the given timer.
The timer class provides a way for mlpack methods to be timed.
static void Stop(const std::string &name)
Stop the given timer.