23 #ifndef __MLPACK_CORE_UTILITIES_TIMERS_HPP 24 #define __MLPACK_CORE_UTILITIES_TIMERS_HPP 29 #if defined(__unix__) || defined(__unix) 33 #elif defined(__MACH__) && defined(__APPLE__) 34 #include <mach/mach_time.h> 48 #if !defined(HAVE_UINT64_T) 49 #if SIZEOF_UNSIGNED_LONG == 8 50 typedef unsigned long uint64_t;
52 typedef unsigned long long uint64_t;
53 #endif // SIZEOF_UNSIGNED_LONG 54 #endif // HAVE_UINT64_T 57 #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) 58 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 60 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL 61 #endif // _MSC_VER, _MSC_EXTENSIONS 86 static void Start(
const std::string& name);
95 static void Stop(
const std::string& name);
102 static timeval
Get(
const std::string& name);
114 std::map<std::string, timeval>& GetAllTimers();
121 timeval GetTimer(
const std::string& timerName);
129 void PrintTimer(
const std::string& timerName);
139 void StartTimer(
const std::string& timerName);
147 void StopTimer(
const std::string& timerName);
152 void FileTimeToTimeVal(timeval* tv);
153 void GetTime(timeval* tv);
158 #endif // __MLPACK_CORE_UTILITIES_TIMERS_HPP Timers()
Nothing to do for the constructor.
Linear algebra utility functions, generally performed on matrices or vectors.
std::map< std::string, timeval > timers
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.